mirror of
https://github.com/jtdaugherty/brick.git
synced 2024-11-29 21:46:11 +03:00
Bind Ctrl-U to delete to BOL edit widget
Ctrl-u will now delete all text from the cursor position to the beginning of the current line. This is a standard readline binding.
This commit is contained in:
parent
4cc231fa29
commit
e6dc695932
@ -88,7 +88,7 @@ library
|
||||
vector,
|
||||
contravariant,
|
||||
text,
|
||||
text-zipper >= 0.2.1,
|
||||
text-zipper >= 0.5,
|
||||
template-haskell,
|
||||
deepseq >= 1.3 && < 1.5
|
||||
|
||||
|
@ -49,6 +49,7 @@ import Brick.AttrMap
|
||||
-- * 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
|
||||
-- * Ctrl-u: delete all from cursor to beginning of line
|
||||
-- * Arrow keys: move cursor
|
||||
-- * Enter: break the current line at the cursor position
|
||||
data Editor n =
|
||||
@ -72,6 +73,7 @@ handleEditorEvent e ed =
|
||||
EvKey (KChar 'e') [MCtrl] -> Z.gotoEOL
|
||||
EvKey (KChar 'd') [MCtrl] -> Z.deleteChar
|
||||
EvKey (KChar 'k') [MCtrl] -> Z.killToEOL
|
||||
EvKey (KChar 'u') [MCtrl] -> Z.killToBOL
|
||||
EvKey KEnter [] -> Z.breakLine
|
||||
EvKey KDel [] -> Z.deleteChar
|
||||
EvKey (KChar c) [] | c /= '\t' -> Z.insertChar c
|
||||
|
Loading…
Reference in New Issue
Block a user