rasa-0.1.5: A modular text editor

Safe HaskellNone
LanguageHaskell2010

Rasa.Internal.Editor

Contents

Synopsis

Accessing/Storing state

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.

range :: Range -> Lens' Buffer YiString Source #

A lens over text which is encompassed by a Range

newtype BufRef Source #

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.

Constructors

BufRef Int