Make selected-fg inherit from list-fg via merge instead of override

selected-fg used o() which replaces the attr from list-fg entirely.
e.g. with fg:dim,selected-fg:italic, the dim was lost on selected
lines because o() replaced dim with italic instead of merging them.
Use ColorAttr.Merge() so attrs are combined additively, consistent
with how current-fg inherits from list-fg.
This commit is contained in:
Junegunn Choi
2026-03-01 20:19:29 +09:00
parent 75e1e352f9
commit d478ff6d50

View File

@@ -1245,7 +1245,7 @@ func InitTheme(theme *ColorTheme, baseTheme *ColorTheme, boldify bool, forceBlac
previewBorderDefined := theme.PreviewBorder != undefined
theme.NthSelectedAttr = theme.SelectedFg.Attr
theme.SelectedFg = o(theme.ListFg, theme.SelectedFg)
theme.SelectedFg = theme.ListFg.Merge(theme.SelectedFg)
theme.SelectedBg = o(theme.ListBg, theme.SelectedBg)
theme.SelectedMatch = o(theme.Match, theme.SelectedMatch)