From ec579900609053ec828c68543fd72c2111dfde88 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 12 Sep 2012 19:09:10 +0200 Subject: [PATCH] whine when a search selected nothing so that the user knows --- src/selectors.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/selectors.cc b/src/selectors.cc index a18da875..90b62dd0 100644 --- a/src/selectors.cc +++ b/src/selectors.cc @@ -401,6 +401,9 @@ SelectionAndCaptures select_next_match(const Selection& selection, for (auto& match : matches) captures.push_back(String(match.first, match.second)); } + else + throw runtime_error("'" + regex + "': no matches found"); + if (begin == end) ++end;