From 8d9ed5e8c7948025eee43a0a0ad30f4cc06b1912 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 2 Jun 2014 15:42:03 +0100 Subject: [PATCH] Fix in region highlighter --- src/highlighters.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/highlighters.cc b/src/highlighters.cc index a51f764e..ab765bb2 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -772,15 +772,14 @@ private: auto modif_it = std::lower_bound(modifs.begin(), modifs.end(), it->line, [](const LineModification& c, const LineCount& l) { return c.old_line < l; }); - bool erase = false; - if (modif_it != modifs.begin()) + + bool erase = (modif_it != modifs.end() and modif_it->old_line == it->line); + if (not erase and modif_it != modifs.begin()) { auto& prev = *(modif_it-1); erase = it->line <= prev.old_line + prev.num_removed; it->line += prev.diff(); } - if (modif_it != modifs.end() and modif_it->old_line == it->line) - erase = true; erase = erase or (it->line >= buffer.line_count()); if (not erase)