From 2acfe852818c6002067e9425bfa432c90abc51c8 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 16 Jun 2014 00:59:05 +0100 Subject: [PATCH] Highlight selection cursors in a second pass This allows cursors to overlap on next selection and still be visible. --- src/highlighters.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/highlighters.cc b/src/highlighters.cc index ab765bb2..3f97df84 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -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; });