From 61b37a6057db4f6474029f9c94534f3a1a016b58 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 2 Sep 2011 18:38:10 +0000 Subject: [PATCH] RegexSelector: search the entire buffer instead of the current line --- src/regex_selector.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/regex_selector.cc b/src/regex_selector.cc index d8b409a3..dcdae64c 100644 --- a/src/regex_selector.cc +++ b/src/regex_selector.cc @@ -14,12 +14,9 @@ Selection RegexSelector::operator()(const BufferIterator& cursor) const try { - while (not line_end.is_end() and *line_end != '\n') - ++line_end; - boost::match_results matches; - if (boost::regex_search(cursor, line_end, matches, m_regex)) + if (boost::regex_search(cursor, cursor.buffer().end(), matches, m_regex, boost::match_nosubs)) return Selection(matches.begin()->first, matches.begin()->second); } catch (boost::regex_error& err)