diff options
Diffstat (limited to 'lib/parse/ansi.go')
-rw-r--r-- | lib/parse/ansi.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/parse/ansi.go b/lib/parse/ansi.go index 94f0c4fc..8b448d77 100644 --- a/lib/parse/ansi.go +++ b/lib/parse/ansi.go @@ -242,13 +242,15 @@ func (rb *RuneBuffer) ApplyStyle(style tcell.Style) { // attributes func (rb *RuneBuffer) ApplyAttrs(style tcell.Style) { for _, sr := range rb.buf { - if sr.Style == tcell.StyleDefault { - sr.Style = style - continue - } _, _, srAttrs := sr.Style.Decompose() - _, _, attrs := style.Decompose() + fg, bg, attrs := style.Decompose() sr.Style = sr.Style.Attributes(srAttrs | attrs) + if fg != tcell.ColorDefault { + sr.Style = sr.Style.Foreground(fg) + } + if bg != tcell.ColorDefault { + sr.Style = sr.Style.Background(bg) + } } } |