Merge remote-tracking branch 'occivink/master'

This commit is contained in:
Maxime Coste 2015-12-29 23:06:35 +00:00
commit f358579e42
7 changed files with 11 additions and 6 deletions

View File

@ -239,12 +239,11 @@ inline bool find_last_match(const Buffer& buffer, const BufferIterator& pos,
const bool is_pos_eol = is_eol(buffer, pos.coord()); const bool is_pos_eol = is_eol(buffer, pos.coord());
const bool is_pos_eow = is_eow(buffer, pos.coord()); const bool is_pos_eow = is_eow(buffer, pos.coord());
auto begin = buffer.begin(); auto begin = buffer.begin();
while (regex_search(begin, pos, matches, regex, while (begin != pos and regex_search(begin, pos, matches, regex,
match_flags(is_bol(begin.coord()), is_pos_eol, is_pos_eow))) match_flags(is_bol(begin.coord()), is_pos_eol, is_pos_eow)))
{ {
if (begin == matches[0].second) begin = utf8::next(matches[0].first, pos);
break; if (res.empty() or matches[0].second > res[0].second)
begin = matches[0].second;
res.swap(matches); res.swap(matches);
} }
return not res.empty(); return not res.empty();

View File

@ -0,0 +1 @@
<a-/>(ab|baba)<ret>

View File

@ -0,0 +1 @@
ababa%(b)

View File

@ -0,0 +1 @@
baba

View File

@ -0,0 +1 @@
<a-/>...<ret>

View File

@ -0,0 +1 @@
abcdefg%(h)

View File

@ -0,0 +1 @@
efg