fzf icon indicating copy to clipboard operation
fzf copied to clipboard

--tiebreak ignores -n

Open NoSuck opened this issue 5 years ago • 1 comments

  • Category
    • [x] fzf binary
    • [ ] fzf-tmux script
    • [ ] Key bindings
    • [ ] Completion
    • [ ] Vim
    • [ ] Neovim
    • [ ] Etc.
  • OS
    • [x] Linux
    • [ ] Mac OS X
    • [ ] Windows
    • [ ] Windows Subsystem for Linux
    • [ ] Etc.
  • Shell
    • [x] bash
    • [ ] zsh
    • [ ] fish

Thank you for fzf. It is one of those tools you can no longer live without, once it has infected your brain.

printf '%s\n' 'a looooooooong' 'aaa short' | fzf -n1

Type a after invoking fzf as above. The aaa short item is selected, even though -n has supposedly limited search scope to the first field (a vs aaa).

It seems that tie-breaking settings ignore -n. Is this a bug? #926 looks to be related.

■ fzf --version
0.18.0 (6577388)

NoSuck avatar Aug 04 '19 05:08 NoSuck

For query a, its a tie for both lines. The default tiebreak is based on length criterion.

What you do: printf '%s\n' 'a looooooooong' 'aaa short' | fzf -n1 --tiebreak=length what you want: printf '%s\n' 'a looooooooong' 'aaa short' | fzf -n1 --tiebreak=index

vovcacik avatar Oct 13 '21 13:10 vovcacik