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