mirror of
https://github.com/junegunn/fzf.git
synced 2026-03-05 14:44:31 +08:00
Distinguish between Ctrl-H and Ctrl-Backspace in Windows (#4590)
Since you can actually distinguish between Ctrl-H and Ctrl-Backspace in Windows we need to reintroduce the tui.CtrlH constant. On *nix systems we map all Ctrl(-Alt)-h to Ctrl(-Alt)-Backspace internally, but you can use either in --bind.
This commit is contained in:
@@ -1225,7 +1225,12 @@ func parseKeyChords(str string, message string) (map[tui.Event]string, []tui.Eve
|
||||
chords[evt] = key
|
||||
list = append(list, evt)
|
||||
} else if len(key) == 6 && strings.HasPrefix(lkey, "ctrl-") && isAlphabet(lkey[5]) {
|
||||
add(tui.EventType(tui.CtrlA.Int() + int(lkey[5]) - 'a'))
|
||||
evt := tui.EventType(tui.CtrlA.Int() + int(lkey[5]) - 'a')
|
||||
r := rune(lkey[5])
|
||||
if r == 'h' && !util.IsWindows() {
|
||||
evt = tui.CtrlBackspace
|
||||
}
|
||||
add(evt)
|
||||
} else if len(runes) == 5 && strings.HasPrefix(lkey, "alt-") {
|
||||
r := runes[4]
|
||||
switch r {
|
||||
|
||||
Reference in New Issue
Block a user