Skip to content
Myr

Fix scrollability of the preview window in certain cases

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

Fix #2683 This commit fixes the cases where fzf incorrectly determines the scrollability of the preview window when `--preview-window-wrap` is set. Wrapping of the preview content happens during the rendering phase, so it's currently not possible to know how many lines are actually needed to display the content beforehand. So `preview-bottom` still may not move to the very bottom with wrapping enabled.

authored by Junegunn Choi · committed by Junegunn Choi · parent a91a676 · Browse files · 1 file+1 added−0 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+1 added−0 removed

  • other:+1 added−0 removed

1 file+1 added−0 removed

modified:src/terminal.go+1 added
1415 unmodified lines
1416 }1417 line = strings.TrimSuffix(line, "\n")1418 if lineNo >= height || t.pwindow.Y() == height-1 && t.pwindow.X() > 0 {1419 t.previewed.filled = true1420 t.previewer.scrollable = true1421 break1422 } else if lineNo >= 0 {1423 var fillRet tui.FillReturn1424 prefixWidth := 0
1489 unmodified lines