@@ -48,19 +48,19 @@ instance Default NextBufId where
48
48
def = NextBufId 0
49
49
50
50
makeLenses ''NextBufId
51
- nextBufId :: HasExts s => Lens' s Int
52
- nextBufId = ext . nextBufId'
51
+ nextBufId :: HasStates s => Lens' s Int
52
+ nextBufId = stateLens . nextBufId'
53
53
54
54
-- | A buffer, holds the text in the buffer and any extension states that are set on the buffer.
55
55
data Buffer = Buffer
56
56
{ _text' :: Y. YiString
57
- , _bufExts ' :: Exts
57
+ , _bufStates ' :: States
58
58
, _ref :: BufRef
59
59
}
60
60
makeLenses ''Buffer
61
61
62
- instance HasExts Buffer where
63
- exts = bufExts '
62
+ instance HasStates Buffer where
63
+ states = bufStates '
64
64
65
65
instance HasEvents Buffer where
66
66
@@ -79,7 +79,7 @@ instance Show Buffer where
79
79
show b = " text:" ++ (Y. toString . Y. take 30 $ (b^. text)) ++ " ...,\n "
80
80
++ " exts: " ++ extText ++ " }>\n "
81
81
where
82
- extText = intercalate " \n " $ show <$> b^. exts . to M. toList
82
+ extText = intercalate " \n " $ show <$> b^. states . to M. toList
83
83
84
84
type BufAction a = Action Buffer a
85
85
@@ -92,14 +92,14 @@ instance Default Buffers where
92
92
def = Buffers mempty
93
93
94
94
-- | A lens over the map of available buffers
95
- buffers :: HasExts s => Lens' s (IM. IntMap Buffer )
96
- buffers = ext . buffers'
95
+ buffers :: HasStates s => Lens' s (IM. IntMap Buffer )
96
+ buffers = stateLens . buffers'
97
97
98
98
-- | Creates a new buffer from the given text.
99
99
mkBuffer :: Y. YiString -> BufRef -> Buffer
100
100
mkBuffer txt bRef =
101
101
Buffer
102
102
{ _text' = txt
103
- , _bufExts ' = mempty
103
+ , _bufStates ' = mempty
104
104
, _ref = bRef
105
105
}
0 commit comments