From 972fb1a29ddd484c97342cf0e7399bd904ded58d Mon Sep 17 00:00:00 2001
From: Junegunn Choi <junegunn.c@gmail.com>
Date: Thu, 2 Mar 2017 12:49:51 +0900
Subject: [PATCH] Suppress ANSI colors in preview window if --no-color is set

---
 src/terminal.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/terminal.go b/src/terminal.go
index 29f2c9d0..c7c21c4f 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -958,7 +958,7 @@ func (t *Terminal) printPreview() {
 					trimmed, _ = t.trimRight(trimmed, maxWidth-t.pwindow.X())
 				}
 				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)
 				} else {
 					fillRet = t.pwindow.Fill(str)
-- 
GitLab