Skip to content
Myr

Fix extra scroll offset in multi-line mode (--read0 or --wrap)

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

Fix #3950

authored by Junegunn Choi · committed by Junegunn Choi · parent dd0737a · Browse files · 1 file+10 added−3 removed
This commit

State

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

Diff stats

1 file+10 added−3 removed

  • other:+10 added−3 removed

1 file+10 added−3 removed

modified:src/terminal.go+10 added-3 removed
4848 unmodified lines
4849 numItemsFound := 04850 linesSum := 048514852 add := func(i int) bool {4853 lines, _ := t.numItemLines(t.merger.Get(i).item, numItems-linesSum)4853 lines, overflow := t.numItemLines(t.merger.Get(i).item, numItems-linesSum)4854 linesSum += lines4855 if linesSum >= numItems {4856 /*4857 # Should show all 3 items4858 printf "file1\0file2\0file3\0" | fzf --height=5 --read0 --bind load:last --reverse48594860 # Should not truncate the last item4861 printf "file\n1\0file\n2\0file\n3\0" | fzf --height=5 --read0 --bind load:last --reverse4862 */4856 if numItemsFound == 0 {4857 numItemsFound = 14863 if numItemsFound == 0 || !overflow {4864 numItemsFound++4865 }4866 return false4867 }4868 numItemsFound++
170 unmodified lines