Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Editor
- class HasEditor c where
- editor :: HasEditor c => Lens' c Editor
- buffers :: HasEditor c => Lens' c (IntMap Buffer)
- exiting :: HasEditor c => Lens' c Bool
- ext :: forall a e. (Show a, Typeable a, Default a, HasEditor e) => Lens' e a
- bufExt :: forall a. (Show a, Typeable a, Default a) => Lens' Buffer a
- nextBufId :: HasEditor c => Lens' c Int
- range :: Range -> Lens' Buffer YiString
- newtype BufRef = BufRef Int
Accessing/Storing state
This is the primary state of the editor.
buffers
is a lens into all buffers.
exiting
Whether the editor is in the process of exiting. Can be set inside an Action
:
exiting .= True
ext :: forall a e. (Show a, Typeable a, Default a, HasEditor e) => Lens' e a Source #
ext
is a lens which will focus the extension state that matches the type
inferred as the focal point. It's a little bit of magic, if you treat the
focus as a member of your extension state it should just work out.
This lens falls back on the extension's Default
instance (when getting) if
nothing has yet been stored.
bufExt :: forall a. (Show a, Typeable a, Default a) => Lens' Buffer a Source #
bufExt
is a lens which will focus a given extension's state within a
buffer (within a BufAction
). The lens will automagically focus
the required extension by using type inference. It's a little bit of magic,
if you treat the focus as a member of your extension state it should just
work out.
This lens falls back on the extension's Default
instance (when getting) if
nothing has yet been stored.
An opaque reference to a buffer (The contained Int is not meant to be
altered). It is possible for references to become stale if buffers are
deleted. Operations over invalid BufRef's are simply ignored and return
Nothing
if a value was expected.