m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-17 15:53:39 -05:00

Fix truncation of colored line when --preview-window wrap is set

Fix #2346
This commit is contained in:
Junegunn Choi
2021-03-12 19:56:24 +09:00
parent 8ae94f0059
commit 7310370a31
2 changed files with 7 additions and 8 deletions

View File

@@ -906,12 +906,6 @@ func (w *LightWindow) fill(str string, onMove func()) FillReturn {
for i, line := range allLines {
lines := wrapLine(line, w.posx, w.width, w.tabstop)
for j, wl := range lines {
if w.posx >= w.Width()-1 && wl.displayWidth == 0 {
if w.posy < w.height-1 {
w.Move(w.posy+1, 0)
}
return FillNextLine
}
w.stderrInternal(wl.text, false)
w.posx += wl.displayWidth
@@ -926,6 +920,9 @@ func (w *LightWindow) fill(str string, onMove func()) FillReturn {
}
}
}
if w.posx >= w.Width()-1 {
return FillNextLine
}
return FillContinue
}