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
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627
1 changed files with 1 additions and 1 deletions

View File

@ -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