feat(mentionslist): configure the selected style with [theme.mentions_list]

This commit is contained in:
ayn2op 2026-10-02 15:34:44 -04:00
parent 1604231f6d
commit 1e42e7783d
3 changed files with 5 additions and 1 deletions

View file

@ -341,6 +341,8 @@ min_width = 20
# 0 = make the list as tall as needed
max_height = 0
selected_style = { attributes = "reverse" }
[theme.dialog]
style = {}
# Background style: everything else behind the dialog

View file

@ -247,6 +247,8 @@ type (
MentionsListTheme struct {
MinWidth uint `toml:"min_width"`
MaxHeight uint `toml:"max_height"`
SelectedStyle StyleWrapper `toml:"selected_style"`
}
DialogTheme struct {

View file

@ -35,7 +35,7 @@ func (m Model) listView() list.Widget {
item := m.items[i]
return row{text: item.DisplayText, style: item.Style}
}).
SelectedStyle(tcell.StyleDefault.Reverse(true)).
SelectedStyle(m.cfg.Theme.MentionsList.SelectedStyle.Style).
Keybind(ui.SelectionKeybind(m.cfg.Keybinds.MentionsList.SelectionKeybinds)).
// The list is only shown while mentions are being completed, so it takes its keys first.
Focused(true).