From 4188335b51242d2185fc1057270702aedcfaf898 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 23 Mar 2015 19:18:56 +0000 Subject: [PATCH] Fix segfault in highlighting --- src/highlighters.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/highlighters.cc b/src/highlighters.cc index 286d9db2..63632528 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -1017,7 +1017,7 @@ public: auto end = std::lower_bound(begin, regions.end(), display_range.second, [](const Region& r, ByteCoord c) { return r.begin < c; }); auto correct = [&](ByteCoord c) -> ByteCoord { - if (buffer[c.line].length() == c.column) + if (not buffer.is_end(c) and buffer[c.line].length() == c.column) return {c.line+1, 0}; return c; };