From 3c06846aa366274e8c40791880bafd973c71c6aa Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 20 Sep 2011 12:00:06 +0000 Subject: [PATCH] RegexSelector: wrap on top if needed --- src/regex_selector.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/regex_selector.cc b/src/regex_selector.cc index 5b9cb041..07dae533 100644 --- a/src/regex_selector.cc +++ b/src/regex_selector.cc @@ -17,6 +17,8 @@ Selection RegexSelector::operator()(const BufferIterator& cursor) const if (boost::regex_search(cursor, cursor.buffer().end(), matches, m_regex, boost::match_nosubs)) return Selection(matches.begin()->first, matches.begin()->second); + else if (boost::regex_search(cursor.buffer().begin(), cursor, matches, m_regex, boost::match_nosubs)) + return Selection(matches.begin()->first, matches.begin()->second); } catch (boost::regex_error& err) {