From 0a2807e6526bf386e0dbf4516d4819a97e46f2bb Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 16 Mar 2018 23:25:37 +1100 Subject: [PATCH] RangesHighlighter: a range that goes up to buffer end is not valid --- src/highlighters.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/highlighters.cc b/src/highlighters.cc index 315dda5a8..cced84afa 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -1469,7 +1469,7 @@ private: try { auto& r = std::get<0>(range); - if (buffer.is_valid(r.first) and buffer.is_valid(r.last)) + if (buffer.is_valid(r.first) and (buffer.is_valid(r.last) and not buffer.is_end(r.last))) highlight_range(display_buffer, r.first, buffer.char_next(r.last), false, apply_face(get_face(std::get<1>(range)))); }