From 30823efe57b832fccfccdb607d4ce52348b8e189 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Sat, 11 Mar 2023 18:28:45 +0100 Subject: style: inherit colors unless explicitly set in layered styles Inherit from the lower layers colors unless explicitly overridden in upper layers. Signed-off-by: Robin Jarry Tested-by: Bence Ferdinandy --- config/style.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/style.go b/config/style.go index 7b13c3a2..2703b257 100644 --- a/config/style.go +++ b/config/style.go @@ -223,10 +223,10 @@ func (s *Style) Set(attr, val string) error { func (s Style) composeWith(styles []*Style) Style { newStyle := s for _, st := range styles { - if st.Fg != s.Fg { + if st.Fg != s.Fg && st.Fg != tcell.ColorDefault { newStyle.Fg = st.Fg } - if st.Bg != s.Bg { + if st.Bg != s.Bg && st.Bg != tcell.ColorDefault { newStyle.Bg = st.Bg } if st.Bold != s.Bold { -- cgit