all repos — minline @ 9b8c532dbbeaadfa2879b8fbc7bcdb97fa03ae41

A minimalist but highly-customizable line editing library.

Add Ctrl+p, Ctrl+n, Ctrl+d, Ctrl+b, Ctrl+f

Change Ctrl+b to Ctrl+a
Change Ctrl+x to Ctrl+u
mwgkgk mwgkgk
Sun, 05 Nov 2017 15:17:21 +0200
commit

9b8c532dbbeaadfa2879b8fbc7bcdb97fa03ae41

parent

77f01870231505cf3c51490736b05c97df432eb6

1 files changed, 12 insertions(+), 2 deletions(-)

jump to
M nimline.nimnimline.nim

@@ -335,15 +335,25 @@ KEYMAP["down"] = proc(ed: var LineEditor) =

ed.historyNext() KEYMAP["up"] = proc(ed: var LineEditor) = ed.historyPrevious() +KEYMAP["ctrl+n"] = proc(ed: var LineEditor) = + ed.historyNext() +KEYMAP["ctrl+p"] = proc(ed: var LineEditor) = + ed.historyPrevious() KEYMAP["left"] = proc(ed: var LineEditor) = ed.back() KEYMAP["right"] = proc(ed: var LineEditor) = ed.forward() +KEYMAP["ctrl+b"] = proc(ed: var LineEditor) = + ed.back() +KEYMAP["ctrl+f"] = proc(ed: var LineEditor) = + ed.forward() KEYMAP["ctrl+c"] = proc(ed: var LineEditor) = quit(0) -KEYMAP["ctrl+x"] = proc(ed: var LineEditor) = +KEYMAP["ctrl+d"] = proc(ed: var LineEditor) = + quit(0) +KEYMAP["ctrl+u"] = proc(ed: var LineEditor) = ed.clearLine() -KEYMAP["ctrl+b"] = proc(ed: var LineEditor) = +KEYMAP["ctrl+a"] = proc(ed: var LineEditor) = ed.goToStart() KEYMAP["ctrl+e"] = proc(ed: var LineEditor) = ed.goToEnd()