pager: Use selected color for parentheses if applicable

This always used pager_completion even for the selected one, now it
uses pager_selected_completion for that.

Fixes #10328
This commit is contained in:
Fabian Boehm
2024-02-28 18:10:49 +01:00
parent 5641ae71b8
commit 31c2eb3f3c

View File

@@ -558,7 +558,14 @@ fn completion_print_item(
} }
assert!(desc_remaining >= 2); assert!(desc_remaining >= 2);
let paren_col = HighlightSpec::with_fg_bg(HighlightRole::pager_completion, bg_role); let paren_col = HighlightSpec::with_fg_bg(
if selected {
HighlightRole::pager_selected_completion
} else {
HighlightRole::pager_completion
},
bg_role,
);
desc_remaining -= print_max(L!("("), paren_col, 1, false, &mut line_data); desc_remaining -= print_max(L!("("), paren_col, 1, false, &mut line_data);
desc_remaining -= desc_remaining -=
print_max(&c.desc, desc_col, desc_remaining - 1, false, &mut line_data); print_max(&c.desc, desc_col, desc_remaining - 1, false, &mut line_data);