From 654e3fcb46338f022284a958b4087162dd148b50 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 8 Oct 2017 11:48:58 +0800 Subject: [PATCH] Fix regions highlighter infinite loops when regex matches empty ranges --- src/highlighters.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/highlighters.cc b/src/highlighters.cc index 62d9b9030..d5314b2cf 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -1673,7 +1673,10 @@ struct RegionMatches --recurse_level; } - beg_pos = end_it->end_coord(); + if (beg_pos != end_it->end_coord()) + beg_pos = end_it->end_coord(); + else + ++end_it; } } };