Highlight selection cursors in a second pass

This allows cursors to overlap on next selection and still be
visible.
This commit is contained in:
Maxime Coste 2014-06-16 00:59:05 +01:00
parent c87e81e8de
commit 2acfe85281

View File

@ -522,6 +522,11 @@ void highlight_selections(const Context& context, HighlightFlags flags, DisplayB
ColorPair sel_colors = get_color(primary ? "PrimarySelection" : "SecondarySelection");
highlight_range(display_buffer, begin, end, false,
[&](DisplayAtom& atom) { atom.colors = sel_colors; });
}
for (size_t i = 0; i < context.selections().size(); ++i)
{
auto& sel = context.selections()[i];
const bool primary = (i == context.selections().main_index());
ColorPair cur_colors = get_color(primary ? "PrimaryCursor" : "SecondaryCursor");
highlight_range(display_buffer, sel.cursor(), buffer.char_next(sel.cursor()), false,
[&](DisplayAtom& atom) { atom.colors = cur_colors; });