Add half-page-{up,down} actions (#784)

pull/812/head
Amos Bird 7 years ago committed by Junegunn Choi
parent 05ed57a9f0
commit 11015df52f

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

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

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

Loading…
Cancel
Save