diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2016-11-19 22:40:28 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2016-11-19 22:42:15 +0900 |
| commit | 8c661d4e8c8a4b643155aa46481ac92f6ebf75b9 (patch) | |
| tree | 6e32a556c2627deab9588e0a226f26c284d7f608 /src/options.go | |
| parent | 4b332d831e3b5cb6dc70484b1a621eae9b162317 (diff) | |
| download | fzf-8c661d4e8c8a4b643155aa46481ac92f6ebf75b9.tar.gz | |
Revamp escape sequence processing for WSL
Also add support for alt-[0-9] and f1[12]
Diffstat (limited to 'src/options.go')
| -rw-r--r-- | src/options.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/options.go b/src/options.go index 6e63d4e6..694084e2 100644 --- a/src/options.go +++ b/src/options.go @@ -330,6 +330,10 @@ func isAlphabet(char uint8) bool { return char >= 'a' && char <= 'z' } +func isNumeric(char uint8) bool { + return char >= '0' && char <= '9' +} + func parseAlgo(str string) algo.Algo { switch str { case "v1": @@ -406,11 +410,17 @@ func parseKeyChords(str string, message string) map[int]string { chord = tui.DoubleClick case "f10": chord = tui.F10 + case "f11": + chord = tui.F11 + case "f12": + chord = tui.F12 default: if len(key) == 6 && strings.HasPrefix(lkey, "ctrl-") && isAlphabet(lkey[5]) { chord = tui.CtrlA + int(lkey[5]) - 'a' } else if len(key) == 5 && strings.HasPrefix(lkey, "alt-") && isAlphabet(lkey[4]) { chord = tui.AltA + int(lkey[4]) - 'a' + } else if len(key) == 5 && strings.HasPrefix(lkey, "alt-") && isNumeric(lkey[4]) { + chord = tui.Alt0 + int(lkey[4]) - '0' } else if len(key) == 2 && strings.HasPrefix(lkey, "f") && key[1] >= '1' && key[1] <= '9' { chord = tui.F1 + int(key[1]) - '1' } else if utf8.RuneCountInString(key) == 1 { |
