summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2023-04-30 18:13:31 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2023-04-30 18:14:40 +0900
commit88d812fe8247310efdcc6365ea68738e469b2076 (patch)
tree984a8dd10d4e6a771a5e221ffc3dffa1ecd8b1f7
parent77f9f4664ac9002358735f152ea429e2a578aee2 (diff)
Do not display trailing carriage returns in the preview window
Close #3269
-rw-r--r--src/terminal.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/terminal.go b/src/terminal.go
index b0771f16..1560cd38 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