aboutsummaryrefslogtreecommitdiffstats
path: root/lib/parse
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-04-12 18:48:35 +0200
committerRobin Jarry <robin@jarry.cc>2023-04-15 17:27:41 +0200
commitc5468febb5552f85c3492070403d97e482670222 (patch)
tree66410ab8ca6d7de0f632c33b6b614cc93d674a9c /lib/parse
parenta9a590a833e2a1616a87b3b9e5fb982ebf8cf1ab (diff)
downloadaerc-c5468febb5552f85c3492070403d97e482670222.tar.gz
templates: change layered fg & bg color priorities
This is mostly a revert of commit ae4d742c5a90 ("templates: fix layered fg & bg color for inline styles"). As it turns out, context colors (msglist_selected, msglist_marked, msglist_deleted, etc.) need to have priority over inline colors. Otherwise strange and confusing results occur. Reported-by: Skejg <grolleman@zoho.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'lib/parse')
-rw-r--r--lib/parse/ansi.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/parse/ansi.go b/lib/parse/ansi.go
index 11424cc5..ff44f8ba 100644
--- a/lib/parse/ansi.go
+++ b/lib/parse/ansi.go
@@ -244,10 +244,10 @@ func (rb *RuneBuffer) ApplyAttrs(style tcell.Style) {
fg, bg, attrs := style.Decompose()
for _, sr := range rb.buf {
srFg, srBg, srAttrs := sr.Style.Decompose()
- if srFg == tcell.ColorDefault {
+ if fg != tcell.ColorDefault {
srFg = fg
}
- if srBg == tcell.ColorDefault {
+ if bg != tcell.ColorDefault {
srBg = bg
}
sr.Style = sr.Style.Attributes(attrs | srAttrs).