diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-06-16 02:18:49 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-06-16 02:18:49 +0900 |
commit | d54a4fa223fa38415f272e7e937ccebefd39a388 (patch) | |
tree | 4a5bf56576387f796948e07decc6727cb579dd85 /src | |
parent | 45bd323cab0fc6c81ccf7f06521bc3d8cc3b9402 (diff) |
Add key name "bspace" for --bind (bspace != ctrl-h)
Diffstat (limited to 'src')
-rw-r--r-- | src/curses/curses.go | 3 | ||||
-rw-r--r-- | src/options.go | 2 | ||||
-rw-r--r-- | src/terminal.go | 1 |
3 files changed, 5 insertions, 1 deletions
diff --git a/src/curses/curses.go b/src/curses/curses.go index 71df2220..4dde2885 100644 --- a/src/curses/curses.go +++ b/src/curses/curses.go @@ -51,6 +51,7 @@ const ( Mouse BTab + BSpace Del PgUp @@ -483,7 +484,7 @@ func GetChar() Event { case CtrlQ: return Event{CtrlQ, 0, nil} case 127: - return Event{CtrlH, 0, nil} + return Event{BSpace, 0, nil} case ESC: return escSequence(&sz) } diff --git a/src/options.go b/src/options.go index 891ea1cc..425b19ef 100644 --- a/src/options.go +++ b/src/options.go @@ -293,6 +293,8 @@ func parseKeyChords(str string, message string, bind bool) []int { chord = curses.CtrlM case "space": chord = curses.AltZ + int(' ') + case "bspace": + chord = curses.BSpace case "tab": chord = curses.Tab case "btab": diff --git a/src/terminal.go b/src/terminal.go index b0812fe6..d17ade1c 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -137,6 +137,7 @@ func defaultKeymap() map[int]actionType { keymap[C.CtrlE] = actEndOfLine keymap[C.CtrlF] = actForwardChar keymap[C.CtrlH] = actBackwardDeleteChar + keymap[C.BSpace] = actBackwardDeleteChar keymap[C.Tab] = actToggleDown keymap[C.BTab] = actToggleUp keymap[C.CtrlJ] = actDown |