m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-14 22:33:47 -05:00

Add 'offset-middle' action

This commit is contained in:
Junegunn Choi
2024-06-17 18:34:10 +09:00
parent 59943cbb48
commit e2401aca68
5 changed files with 66 additions and 55 deletions

View File

@@ -451,6 +451,7 @@ const (
actHalfPageDown
actOffsetUp
actOffsetDown
actOffsetMiddle
actJump
actJumpAccept // XXX Deprecated in favor of jump:accept binding
actPrintQuery // XXX Deprecated (not very useful, just use --print-query)
@@ -4199,6 +4200,11 @@ func (t *Terminal) Loop() error {
t.vmove(diff, false)
}
req(reqList)
case actOffsetMiddle:
soff := t.scrollOff
t.scrollOff = t.window.Height()
t.constrain()
t.scrollOff = soff
case actJump:
t.jumping = jumpEnabled
req(reqJump)