Add "last" action to move the cursor to the last match
Before adoption: this commit came in with the history the project adopted, so no landing records it.
This is the opposite of "first" (previously known as "top").
authored by Junegunn Choi · committed by Junegunn Choi · parent e9bc733 · Browse files · 5 files·+20 added−10 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+20 added−10 removed
- other:+20 added−10 removed
Provenance
- Commit
0de7ab1- Tree
65de1c0- Author
Junegunn Choi <junegunn.c@gmail.com>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
e9bc733
5 files changed+20 added−10 removed
modified:man/man1/fzf.1+5 added-4 removed
19 unmodified lines20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN22 THE SOFTWARE.23 ..24-.TH fzf 1 "Dec 2020" "fzf 0.24.4" "fzf - a command-line fuzzy finder"24+.TH fzf 1 "Dec 2020" "fzf 0.24.5" "fzf - a command-line fuzzy finder"25 26 .SH NAME27 fzf - a command-line fuzzy finder28 720 unmodified lines749 .RS750 Triggered whenever the query string is changed751 752 e.g.753- \fB# Moves cursor to the top (or bottom depending on --layout) whenever the query is changed754- fzf --bind change:top\fR753+ \fB# Move cursor to the first entry whenever the query is changed754+ fzf --bind change:first\fR755 .RE756 757 \fIbackward-eof\fR758 .RS28 unmodified lines787 \fBdown\fR \fIctrl-j ctrl-n down\fR788 \fBend-of-line\fR \fIctrl-e end\fR789 \fBexecute(...)\fR (see below for the details)790 \fBexecute-silent(...)\fR (see below for the details)791+ \fBfirst\fR (move to the first match)792 \fBforward-char\fR \fIctrl-f right\fR793 \fBforward-word\fR \fIalt-f shift-right\fR794 \fBignore\fR795 \fBjump\fR (EasyMotion-like 2-keystroke movement)796 \fBjump-accept\fR (jump and accept)797 \fBkill-line\fR798 \fBkill-word\fR \fIalt-d\fR799+ \fBlast\fR (move to the last match)800 \fBnext-history\fR (\fIctrl-n\fR on \fB--history\fR)801 \fBpage-down\fR \fIpgdn\fR802 \fBpage-up\fR \fIpgup\fR803 \fBhalf-page-down\fR19 unmodified lines823 \fBtoggle-preview\fR824 \fBtoggle-preview-wrap\fR825 \fBtoggle-sort\fR826 \fBtoggle+up\fR \fIbtab (shift-tab)\fR825- \fBtop\fR (move to the top result)827 \fBunix-line-discard\fR \fIctrl-u\fR828 \fBunix-word-rubout\fR \fIctrl-w\fR829 \fBup\fR \fIctrl-k ctrl-p up\fR830 \fByank\fR \fIctrl-y\fR114 unmodified linesmodified:src/options_test.go+2 added-2 removed
244 unmodified lines245 "ctrl-a:kill-line,ctrl-b:toggle-sort+up+down,c:page-up,alt-z:page-down,"+246 "f1:execute(ls {+})+abort+execute(echo {+})+select-all,f2:execute/echo {}, {}, {}/,f3:execute[echo '({})'],f4:execute;less {};,"+247 "alt-a:execute-Multi@echo (,),[,],/,:,;,%,{}@,alt-b:execute;echo (,),[,],/,:,@,%,{};,"+248 "x:Execute(foo+bar),X:execute/bar+baz/"+249- ",f1:+top,f1:+top"+249+ ",f1:+first,f1:+top"+250 ",,:abort,::accept,+:execute:++\nfoobar,Y:execute(baz)+up")251 check(tui.CtrlA, "", actKillLine)252 check(tui.CtrlB, "", actToggleSort, actUp, actDown)253 check(tui.AltZ+'c', "", actPageUp)254 check(tui.AltZ+',', "", actAbort)255 check(tui.AltZ+':', "", actAccept)256 check(tui.AltZ, "", actPageDown)257- check(tui.F1, "ls {+}", actExecute, actAbort, actExecute, actSelectAll, actTop, actTop)257+ check(tui.F1, "ls {+}", actExecute, actAbort, actExecute, actSelectAll, actFirst, actFirst)258 check(tui.F2, "echo {}, {}, {}", actExecute)259 check(tui.F3, "echo '({})'", actExecute)260 check(tui.F4, "less {}", actExecute)261 check(tui.AltZ+'x', "foo+bar", actExecute)187 unmodified linesmodified:src/options.go+4 added-2 removed
877 unmodified lines878 case "down":879 appendAction(actDown)880 case "up":881 appendAction(actUp)882- case "top":883- appendAction(actTop)882+ case "first", "top":883+ appendAction(actFirst)884+ case "last":885+ appendAction(actLast)886 case "page-up":887 appendAction(actPageUp)888 case "page-down":889 appendAction(actPageDown)692 unmodified linesmodified:src/terminal.go+6 added-2 removed
263 unmodified lines264 actExecute265 actExecuteSilent266 actExecuteMulti // Deprecated267 actSigStop268- actTop268+ actFirst269+ actLast270 actReload271 )272 273 type placeholderFlags struct {2092 unmodified lines2366 t.selected = make(map[int32]selectedItem)2367 t.version++2368 req(reqList, reqInfo)2369 }2369- case actTop:2370+ case actFirst:2371 t.vset(0)2372 req(reqList)2373+ case actLast:2374+ t.vset(t.merger.Length() - 1)2375+ req(reqList)2376 case actUnixLineDiscard:2377 beof = len(t.input) == 02378 if t.cx > 0 {2379 t.yanked = copySlice(t.input[:t.cx])260 unmodified linesmodified:CHANGELOG.md+3 added
21 unmodified lines22 23 # Write "regular" if you want to clear the attributes24 fzf --color hl:176:regular,hl+:177:regular25 ```26+- Added `last` action to move the cursor to the last match27+ - The opposite action `top` is renamed to `first`, but `top` is still28+ recognized as a synonym for backward compatibility29 30 0.24.431 ------32 - Added `--preview-window` option `follow`1032 unmodified lines