Add key name "bspace" for --bind (bspace != ctrl-h)

This commit is contained in:
Junegunn Choi 2015-06-16 02:18:49 +09:00
parent 45bd323cab
commit d54a4fa223
3 changed files with 5 additions and 1 deletions

View File

@ -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)
}

View File

@ -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":

View File

@ -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