mirror of
https://github.com/jtdaugherty/brick.git
synced 2024-11-29 10:54:48 +03:00
Merge pull request #330 from mlang/goto
Edit: Bind M-< and M-> to gotoBOF and gotoEOF
This commit is contained in:
commit
9a08fa1e9e
@ -131,7 +131,7 @@ library
|
||||
contravariant,
|
||||
stm >= 2.4.3,
|
||||
text,
|
||||
text-zipper >= 0.7.1,
|
||||
text-zipper >= 0.11,
|
||||
template-haskell,
|
||||
deepseq >= 1.3 && < 1.5,
|
||||
unix,
|
||||
|
@ -59,8 +59,10 @@ import Brick.AttrMap
|
||||
|
||||
-- | Editor state. Editors support the following events by default:
|
||||
--
|
||||
-- * Ctrl-a: go to beginning of line
|
||||
-- * Ctrl-e: go to end of line
|
||||
-- * Meta-<: go to beginning of file
|
||||
-- * Meta->: go to end of file
|
||||
-- * Ctrl-a, Home: go to beginning of line
|
||||
-- * Ctrl-e, End: go to end of line
|
||||
-- * Ctrl-d, Del: delete character at cursor position
|
||||
-- * Backspace: delete character prior to cursor position
|
||||
-- * Ctrl-k: delete all from cursor to end of line
|
||||
@ -126,6 +128,8 @@ handleEditorEvent e ed =
|
||||
EvKey KBS [] -> Z.deletePrevChar
|
||||
EvKey KHome [] -> Z.gotoBOL
|
||||
EvKey KEnd [] -> Z.gotoEOL
|
||||
EvKey (KChar '<') [MMeta] -> Z.gotoBOF
|
||||
EvKey (KChar '>') [MMeta] -> Z.gotoEOF
|
||||
_ -> id
|
||||
in return $ applyEdit f ed
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user