Skip to content
Myr

Add offset-up and offset-down

Before adoption: this commit came in with the history the project adopted, so no landing records it.

# Scrolling will behave similarly to CTRL-E and CTRL-Y of vim fzf --bind scroll-up:offset-up,scroll-down:offset-down \ --bind ctrl-y:offset-up,ctrl-e:offset-down \ --scroll-off=5 Close #3456

authored by Junegunn Choi · committed by Junegunn Choi · parent 4feaf31 · Browse files · 4 files+29 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+29 added−0 removed

  • other:+29 added−0 removed

4 files+29 added−0 removed

modified:man/man1/fzf.1+2 added
1155 unmodified lines
1156 \fBpage-up\fR \fIpgup\fR1157 \fBhalf-page-down\fR1158 \fBhalf-page-up\fR1159 \fBhide-preview\fR1160 \fBoffset-down\fR (similar to CTRL-E of Vim)1161 \fBoffset-up\fR (similar to CTRL-Y of Vim)1162 \fBpos(...)\fR (move cursor to the numeric position; negative number to count from the end)1163 \fBprev-history\fR (\fIctrl-p\fR on \fB--history\fR)1164 \fBprev-selected\fR (move to the previous selected item)1165 \fBpreview(...)\fR (see below for the details)
195 unmodified lines
modified:src/options.go+4 added
1177 unmodified lines
1178 case "toggle-preview-wrap":1179 appendAction(actTogglePreviewWrap)1180 case "toggle-sort":1181 appendAction(actToggleSort)1182 case "offset-up":1183 appendAction(actOffsetUp)1184 case "offset-down":1185 appendAction(actOffsetDown)1186 case "preview-top":1187 appendAction(actPreviewTop)1188 case "preview-bottom":1189 appendAction(actPreviewBottom)
950 unmodified lines
modified:src/terminal.go+15 added
376 unmodified lines
377 actPageDown378 actPosition379 actHalfPageUp380 actHalfPageDown381 actOffsetUp382 actOffsetDown383 actJump384 actJumpAccept385 actPrintQuery386 actRefreshPreview
3018 unmodified lines
3405 req(reqList)3406 case actHalfPageDown:3407 t.vmove(-(t.maxItems() / 2), false)3408 req(reqList)3409 case actOffsetUp, actOffsetDown:3410 diff := 13411 if a.t == actOffsetDown {3412 diff = -13413 }3414 t.offset += diff3415 before := t.offset3416 t.constrain()3417 if before != t.offset {3418 t.offset = before3419 t.vmove(diff, false)3420 }3421 req(reqList)3422 case actJump:3423 t.jumping = jumpEnabled3424 req(reqJump)3425 case actJumpAccept:
468 unmodified lines
modified:CHANGELOG.md+8 added
53 unmodified lines
54 --bind 'preview-scroll-up:preview-up+preview-up' \55 --bind 'preview-scroll-down:preview-down+preview-down' \56 --preview 'cat {}'57 ```58- Added `offset-up` and `offset-down` actions59 ```sh60 # Scrolling will behave similarly to CTRL-E and CTRL-Y of vim61 fzf --bind scroll-up:offset-up,scroll-down:offset-down \62 --bind ctrl-y:offset-up,ctrl-e:offset-down \63 --scroll-off=564 ```65- Shell extensions66 - Updated bash completion for fzf options67 - bash key bindings no longer requires perl; it will use awk or mawk68 instead if perl is not found69 - Basic context-aware completion for ssh command70 - Applied `--scheme=path` for better ordering of the result
1667 unmodified lines