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

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