Fix backward search searching from on char before the corret one.

Fixes #406
This commit is contained in:
Maxime Coste 2015-09-14 14:28:45 +01:00
parent a2b4bf09fd
commit e0049bb587
4 changed files with 4 additions and 2 deletions

View File

@ -274,8 +274,7 @@ Selection find_next_match(const Buffer& buffer, const Selection& sel, const Rege
CaptureList captures;
MatchResults<BufferIterator> matches;
bool found = false;
auto pos = direction == Forward ? utf8::next(begin, buffer.end())
: utf8::previous(begin, buffer.begin());
auto pos = direction == Forward ? utf8::next(begin, buffer.end()) : begin;
if ((found = find_match_in_buffer<direction>(buffer, pos, matches, regex)))
{
begin = ensure_char_start(buffer, matches[0].first);

View File

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

View File

@ -0,0 +1 @@
xxx%(y)yyxxx

View File

@ -0,0 +1 @@
1.1,1.3