Safe Haskell | None |
---|---|
Language | Haskell2010 |
Widget like Brick.Widgets.Edit, but with more emacs style keybindings.
This is also a complete wrapper around the Brick.Widgets.Edit API to retain compatability with older brick versions.
See handleEditorEvent
for a list of added keybindings.
Synopsis
- data Editor n
- editorText :: n -> ([Text] -> Widget n) -> Maybe Int -> Text -> Editor n
- getEditContents :: Editor n -> [Text]
- applyEdit :: (TextZipper Text -> TextZipper Text) -> Editor n -> Editor n
- editContentsL :: Lens (Editor n) (Editor n) (TextZipper Text) (TextZipper Text)
- handleEditorEvent :: Event -> Editor n -> EventM n (Editor n)
- renderEditor :: (Ord n, Show n) => Bool -> Editor n -> Widget n
Documentation
editorText :: n -> ([Text] -> Widget n) -> Maybe Int -> Text -> Editor n Source #
Wrapper for editorText
specialized to Text
getEditContents :: Editor n -> [Text] Source #
Wrapper for getEditContents
specialized to Text
applyEdit :: (TextZipper Text -> TextZipper Text) -> Editor n -> Editor n Source #
editContentsL :: Lens (Editor n) (Editor n) (TextZipper Text) (TextZipper Text) Source #
Wrapper for editContentsL
specialized to Text
handleEditorEvent :: Event -> Editor n -> EventM n (Editor n) Source #
Same as handleEditorEvent
, but with more emacs-style keybindings and
specialized to Text
Specifically:
- Ctrl-f: Move forward one character
- Ctrl-b: Move backward one character
- Alt-f: Move forward one word
- Alt-b: Move backward one word
- Alt-Backspace: Delete the previous word
- Ctrl-w: Delete the previous word
- Alt-d: Delete the next word
renderEditor :: (Ord n, Show n) => Bool -> Editor n -> Widget n Source #
Wrapper for renderEditor
specialized to Text