From e86e3bda4d1b86db6f6b544f9eec574d046d1f41 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 19 Sep 2012 14:04:09 +0200 Subject: [PATCH] select_all_matches: reject match that start at the end of originating selection --- src/selectors.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/selectors.cc b/src/selectors.cc index 90b62dd0..5282e7f6 100644 --- a/src/selectors.cc +++ b/src/selectors.cc @@ -430,6 +430,9 @@ SelectionAndCapturesList select_all_matches(const Selection& selection, BufferIterator begin = (*re_it)[0].first; BufferIterator end = (*re_it)[0].second; + if (begin == selection.end()) + continue; + CaptureList captures; for (auto& match : *re_it) captures.push_back(String(match.first, match.second));