RegexSelector: search the entire buffer instead of the current line
This commit is contained in:
parent
39f12a1766
commit
61b37a6057
|
@ -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<BufferIterator> 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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user