Fix case where preview window is not scrollable (#4258)

When the last rendered line was wrapped, fzf would incorrectly determine
the scrollability of the window.
This commit is contained in:
Junegunn Choi
2025-02-20 08:22:12 +09:00
parent 81c51c26cc
commit 0ba066123e

View File

@@ -3384,8 +3384,10 @@ func (t *Terminal) renderPreviewText(height int, lines []string, lineNo int, unc
wiped := false
image := false
wireframe := false
var index int
var line string
Loop:
for _, line := range lines {
for index, line = range lines {
var lbg tui.Color = -1
if ansi != nil {
ansi.lbg = -1
@@ -3528,6 +3530,7 @@ Loop:
}
lineNo++
}
t.previewer.scrollable = t.previewer.scrollable || index < len(lines)-1
t.previewed.image = image
t.previewed.wireframe = wireframe
}