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

Do not display trailing carriage returns in the preview window

Close #3269
This commit is contained in:
Junegunn Choi
2023-04-30 18:13:31 +09:00
parent 77f9f4664a
commit 88d812fe82

View File

@@ -1872,7 +1872,7 @@ func (t *Terminal) renderPreviewText(height int, lines []string, lineNo int, unc
if ansi != nil { if ansi != nil {
ansi.lbg = -1 ansi.lbg = -1
} }
line = strings.TrimSuffix(line, "\n") line = strings.TrimRight(line, "\r\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 t.previewer.scrollable = true