m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 00:03:39 -05:00

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

This commit is contained in:
Amos Bird
2017-01-16 10:58:13 +08:00
committed by Junegunn Choi
parent 05ed57a9f0
commit 11015df52f
3 changed files with 14 additions and 0 deletions

View File

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

View File

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