m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 15:23:48 -05:00

Fix scrollability of the preview window in certain cases

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.
This commit is contained in:
Junegunn Choi
2022-04-28 11:24:59 +09:00
parent a91a67668e
commit b089bb5e7b

View File

@@ -1417,6 +1417,7 @@ func (t *Terminal) renderPreviewText(height int, lines []string, lineNo int, unc
line = strings.TrimSuffix(line, "\n") line = strings.TrimSuffix(line, "\n")
if lineNo >= height || t.pwindow.Y() == height-1 && t.pwindow.X() > 0 { if lineNo >= height || t.pwindow.Y() == height-1 && t.pwindow.X() > 0 {
t.previewed.filled = true t.previewed.filled = true
t.previewer.scrollable = true
break break
} else if lineNo >= 0 { } else if lineNo >= 0 {
var fillRet tui.FillReturn var fillRet tui.FillReturn