diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2018-02-15 19:56:11 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2018-02-15 19:57:21 +0900 |
| commit | 417bca03dfa9a15a37d64678b5a4a175db6eb0a1 (patch) | |
| tree | e8ae00a755c07dc9ff6bfcb3fe18620fd7e558a0 /src | |
| parent | cce6aef557b22e28269e1b435e1079a694d43f92 (diff) | |
| download | fzf-417bca03dfa9a15a37d64678b5a4a175db6eb0a1.tar.gz | |
Add shift-up and shift-down
For now, they are respectively bound to preview-up and preview-down
by default (TBD).
Not available on tcell build.
Close #1201
Diffstat (limited to 'src')
| -rw-r--r-- | src/options.go | 4 | ||||
| -rw-r--r-- | src/terminal.go | 3 | ||||
| -rw-r--r-- | src/tui/light.go | 21 | ||||
| -rw-r--r-- | src/tui/tui.go | 2 |
4 files changed, 18 insertions, 12 deletions
diff --git a/src/options.go b/src/options.go index 160fdd01..bec4d32e 100644 --- a/src/options.go +++ b/src/options.go @@ -426,6 +426,10 @@ func parseKeyChords(str string, message string) map[int]string { chord = tui.PgUp case "pgdn", "page-down": chord = tui.PgDn + case "shift-up": + chord = tui.SUp + case "shift-down": + chord = tui.SDown case "shift-left": chord = tui.SLeft case "shift-right": diff --git a/src/terminal.go b/src/terminal.go index e3caaad7..e91b3834 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -277,6 +277,9 @@ func defaultKeymap() map[int][]action { keymap[tui.PgUp] = toActions(actPageUp) keymap[tui.PgDn] = toActions(actPageDown) + keymap[tui.SUp] = toActions(actPreviewUp) + keymap[tui.SDown] = toActions(actPreviewDown) + keymap[tui.Rune] = toActions(actRune) keymap[tui.Mouse] = toActions(actMouse) keymap[tui.DoubleClick] = toActions(actAccept) diff --git a/src/tui/light.go b/src/tui/light.go index 578961ed..9b1489fa 100644 --- a/src/tui/light.go +++ b/src/tui/light.go @@ -458,25 +458,22 @@ func (r *LightRenderer) escSequence(sz *int) Event { } } return Event{Invalid, 0, nil} - case 59: + case ';': if len(r.buffer) != 6 { return Event{Invalid, 0, nil} } *sz = 6 switch r.buffer[4] { - case 50: + case '2', '5': switch r.buffer[5] { - case 68: - return Event{Home, 0, nil} - case 67: - return Event{End, 0, nil} - } - case 53: - switch r.buffer[5] { - case 68: - return Event{SLeft, 0, nil} - case 67: + case 'A': + return Event{SUp, 0, nil} + case 'B': + return Event{SDown, 0, nil} + case 'C': return Event{SRight, 0, nil} + case 'D': + return Event{SLeft, 0, nil} } } // r.buffer[4] } // r.buffer[3] diff --git a/src/tui/tui.go b/src/tui/tui.go index fff3572f..e2f5ea58 100644 --- a/src/tui/tui.go +++ b/src/tui/tui.go @@ -61,6 +61,8 @@ const ( Home End + SUp + SDown SLeft SRight |
