summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2017-09-08 18:33:17 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2017-09-08 18:33:17 +0900
commit7cfa6f0265a7a786b931dde03b75843124a984b2 (patch)
treeaadbb64130e9ac353423c10d31135f3395add3d7 /src
parente3973c74e7eeb40eede286c88380402ef6996a88 (diff)
downloadfzf-7cfa6f0265a7a786b931dde03b75843124a984b2.tar.gz
Fix custom foreground color inside preview window (addendum)
This fixes foreground color inside preview window when the text has ANSI attributes except for foreground color. Close #1046
Diffstat (limited to 'src')
-rw-r--r--src/tui/light.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tui/light.go b/src/tui/light.go
index 15f4e012..fe9035ea 100644
--- a/src/tui/light.go
+++ b/src/tui/light.go
@@ -105,6 +105,7 @@ type LightWindow struct {
posx int
posy int
tabstop int
+ fg Color
bg Color
}
@@ -633,8 +634,10 @@ func (r *LightRenderer) NewWindow(top int, left int, width int, height int, bord
width: width,
height: height,
tabstop: r.tabstop,
+ fg: colDefault,
bg: colDefault}
if r.theme != nil {
+ w.fg = r.theme.Fg
w.bg = r.theme.Bg
}
w.drawBorder()
@@ -881,6 +884,9 @@ func (w *LightWindow) Fill(text string) FillReturn {
func (w *LightWindow) CFill(fg Color, bg Color, attr Attr, text string) FillReturn {
w.Move(w.posy, w.posx)
+ if fg == colDefault {
+ fg = w.fg
+ }
if bg == colDefault {
bg = w.bg
}