-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
Description
Checklist
- I have read through the manual page (
man fzf) - I have searched through the existing issues
- For bug reports, I have checked if the bug is reproducible in the latest version of fzf
Output of fzf --version
0.66.1 (brew)
OS
- Linux
- macOS
- Windows
- Etc.
Shell
- bash
- zsh
- fish
Problem / Steps to reproduce
When long lines are present the --keep-right option seems to lose effect as soon as a search term is entered and results are being highlighted.
Here's an example:
(cat <<EOF
/short/path/file.bla
/A/very/long/path/that/is/shomewhere/deep/on/the/users/hard/disk/and/really/shouldnt/be/this/deeply/nested/somefile.txt
/A/very/long/path/that/is/shomewhere/deep/on/the/users/hard/disk/and/really/shouldnt/be/this/deeply/nested/otherfile.txt
/A/very/long/path/that/is/shomewhere/deep/on/the/users/hard/disk/and/really/shouldnt/be/this/deeply/nested/foobar.txt
EOF
) | fzf --keep-right --preview 'echo "{}"' -q thisOutput in an 80x15 terminal:
╭──────────────────────────────────────╮
│ '/A/very/long/path/that/is/shomewher │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
▌ ··really/shouldnt/be/this/deeply/ne·· │ │
▌ ··really/shouldnt/be/this/deeply/ne·· │ │
▌ ··really/shouldnt/be/this/deeply/ne·· │ │
3/4 ───────────────────────────────── │ │
> this ╰──────────────────────────────────────╯
As you can see the search term this has moved to the middle of the line, violating the --keep-right option, even though there would be enough room to show the entire rightmost part of the line while still keeping this in view.
(Of course ignoring keep-right is fine when the search term occurs so far on the left that it's not possible to keep the right edge in view.)