Skip to content
Snippets Groups Projects
Unverified Commit 7cfa6f02 authored by Junegunn Choi's avatar Junegunn Choi
Browse files

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
parent e3973c74
No related branches found
No related tags found
No related merge requests found
...@@ -105,6 +105,7 @@ type LightWindow struct { ...@@ -105,6 +105,7 @@ type LightWindow struct {
posx int posx int
posy int posy int
tabstop int tabstop int
fg Color
bg Color bg Color
} }
...@@ -633,8 +634,10 @@ func (r *LightRenderer) NewWindow(top int, left int, width int, height int, bord ...@@ -633,8 +634,10 @@ func (r *LightRenderer) NewWindow(top int, left int, width int, height int, bord
width: width, width: width,
height: height, height: height,
tabstop: r.tabstop, tabstop: r.tabstop,
fg: colDefault,
bg: colDefault} bg: colDefault}
if r.theme != nil { if r.theme != nil {
w.fg = r.theme.Fg
w.bg = r.theme.Bg w.bg = r.theme.Bg
} }
w.drawBorder() w.drawBorder()
...@@ -881,6 +884,9 @@ func (w *LightWindow) Fill(text string) FillReturn { ...@@ -881,6 +884,9 @@ func (w *LightWindow) Fill(text string) FillReturn {
func (w *LightWindow) CFill(fg Color, bg Color, attr Attr, text string) FillReturn { func (w *LightWindow) CFill(fg Color, bg Color, attr Attr, text string) FillReturn {
w.Move(w.posy, w.posx) w.Move(w.posy, w.posx)
if fg == colDefault {
fg = w.fg
}
if bg == colDefault { if bg == colDefault {
bg = w.bg bg = w.bg
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment