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));