diff options
| author | Amos Bird <amosbird@gmail.com> | 2017-01-16 10:58:13 +0800 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2017-01-16 11:58:13 +0900 |
| commit | 11015df52f19a7eb551c460783c2f8ffb6c8afaf (patch) | |
| tree | 8e742cbb54f5e7ff11c9959054d5d7748c67437b | |
| parent | 05ed57a9f06cc59f07065f74051012c80088d1f2 (diff) | |
| download | fzf-11015df52f19a7eb551c460783c2f8ffb6c8afaf.tar.gz | |
Add half-page-{up,down} actions (#784)
| -rw-r--r-- | man/man1/fzf.1 | 2 | ||||
| -rw-r--r-- | src/options.go | 4 | ||||
| -rw-r--r-- | src/terminal.go | 8 |
3 files changed, 14 insertions, 0 deletions
diff --git a/man/man1/fzf.1 b/man/man1/fzf.1 index a7abf84b..0225c8ea 100644 --- a/man/man1/fzf.1 +++ b/man/man1/fzf.1 @@ -470,6 +470,8 @@ e.g. \fBfzf --bind=ctrl-j:accept,ctrl-k:kill-line\fR \fBnext-history\fR (\fIctrl-n\fR on \fB--history\fR) \fBpage-down\fR \fIpgdn\fR \fBpage-up\fR \fIpgup\fR + \fBhalf-page-down\fR + \fBhalf-page-up\fR \fBpreview-down\fR \fBpreview-up\fR \fBpreview-page-down\fR diff --git a/src/options.go b/src/options.go index 7885325e..16020ddf 100644 --- a/src/options.go +++ b/src/options.go @@ -688,6 +688,10 @@ func parseKeymap(keymap map[int]actionType, execmap map[int]string, str string) keymap[key] = actPageUp case "page-down": keymap[key] = actPageDown + case "half-page-up": + keymap[key] = actHalfPageUp + case "half-page-down": + keymap[key] = actHalfPageDown case "previous-history": keymap[key] = actPreviousHistory case "next-history": diff --git a/src/terminal.go b/src/terminal.go index 02c8f1fe..4d207b48 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -186,6 +186,8 @@ const ( actUp actPageUp actPageDown + actHalfPageUp + actHalfPageDown actJump actJumpAccept actPrintQuery @@ -1478,6 +1480,12 @@ func (t *Terminal) Loop() { case actPageDown: t.vmove(-(t.maxItems() - 1)) req(reqList) + case actHalfPageUp: + t.vmove(t.maxItems() / 2) + req(reqList) + case actHalfPageDown: + t.vmove(-(t.maxItems() / 2)) + req(reqList) case actJump: t.jumping = jumpEnabled req(reqJump) |
