Suppress ANSI colors in preview window if --no-color is set

This commit is contained in:
Junegunn Choi 2017-03-02 12:49:51 +09:00
parent 3a6af27586
commit 972fb1a29d
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -958,7 +958,7 @@ func (t *Terminal) printPreview() {
trimmed, _ = t.trimRight(trimmed, maxWidth-t.pwindow.X()) trimmed, _ = t.trimRight(trimmed, maxWidth-t.pwindow.X())
} }
str, _ = t.processTabs(trimmed, 0) str, _ = t.processTabs(trimmed, 0)
if ansi != nil && ansi.colored() { if t.theme != nil && ansi != nil && ansi.colored() {
fillRet = t.pwindow.CFill(ansi.fg, ansi.bg, ansi.attr, str) fillRet = t.pwindow.CFill(ansi.fg, ansi.bg, ansi.attr, str)
} else { } else {
fillRet = t.pwindow.Fill(str) fillRet = t.pwindow.Fill(str)