Open vejkse opened 2 days ago
Thanks for the report. It should be fixed now on master.
Thank you!
But I think it doesn’t work in all cases. I should have made an example with variable length, like this one where each item n > 1 has ⌈n/2⌉ + 1 lines:
for i in {1..99}; do printf "item $i, line %d\n" $(seq 1 $((i/2))); echo -ne "item $i, line $((i/2+1))\0"; done | fzf --read0 --reverse --height=23
Here is how it goes when repeating page-down
:
After that, we see all items but some only partially even though they could be fully visible if from that point on, page-down
became equivalent to down
.
Of course, once we get to items that have too many lines to be shown in that limited height, they will never be fully visible.
Even a uniform 3-line case has a little problem, like this one:
for i in {01..99}; do echo -ne "item $i, line 1\nitem $i, line 2\nitem $i, line 3\0"; done | fzf --read0 --reverse --height=22
When repeating page-down
, after the initial steps, only two lines of the last item on each page are visible, but the full item is not visible on the next page. One could argue that this is acceptable, I suppose.
Checklist
man fzf
)Output of
fzf --version
0.56 (devel)
OS
Shell
Problem / Steps to reproduce
With one-line items, when doing PgUp (bound by default to
page-up
) and PgDn (bound by default topage-down
), if 21 lines (and so 21 items) are visible as in the following example:each movement one page up or down goes 20 lines (and so 20 items) up or down the list, as one would expect.
But in the following example with 2-line items, where 21 lines (and so 10.5 items) are visible:
each movement one page up or down doesn’t go about 20 lines up or down the list, as one would expect, but 20 items (so 40 lines) up or down the list, so that each time we go up or down, we skip about 10 items.