From 88d812fe8247310efdcc6365ea68738e469b2076 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 30 Apr 2023 18:13:31 +0900 Subject: [PATCH] Do not display trailing carriage returns in the preview window Close #3269 --- src/terminal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/terminal.go b/src/terminal.go index b0771f1..1560cd3 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -1872,7 +1872,7 @@ func (t *Terminal) renderPreviewText(height int, lines []string, lineNo int, unc if ansi != nil { 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 { t.previewed.filled = true t.previewer.scrollable = true