Fix backward search searching from on char before the corret one.
Fixes #406
This commit is contained in:
parent
a2b4bf09fd
commit
e0049bb587
|
@ -274,8 +274,7 @@ Selection find_next_match(const Buffer& buffer, const Selection& sel, const Rege
|
||||||
CaptureList captures;
|
CaptureList captures;
|
||||||
MatchResults<BufferIterator> matches;
|
MatchResults<BufferIterator> matches;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
auto pos = direction == Forward ? utf8::next(begin, buffer.end())
|
auto pos = direction == Forward ? utf8::next(begin, buffer.end()) : begin;
|
||||||
: utf8::previous(begin, buffer.begin());
|
|
||||||
if ((found = find_match_in_buffer<direction>(buffer, pos, matches, regex)))
|
if ((found = find_match_in_buffer<direction>(buffer, pos, matches, regex)))
|
||||||
{
|
{
|
||||||
begin = ensure_char_start(buffer, matches[0].first);
|
begin = ensure_char_start(buffer, matches[0].first);
|
||||||
|
|
1
test/compose/backward-search/cmd
Normal file
1
test/compose/backward-search/cmd
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<a-/>xxx<ret>
|
1
test/compose/backward-search/in
Normal file
1
test/compose/backward-search/in
Normal file
|
@ -0,0 +1 @@
|
||||||
|
xxx%(y)yyxxx
|
1
test/compose/backward-search/state
Normal file
1
test/compose/backward-search/state
Normal file
|
@ -0,0 +1 @@
|
||||||
|
1.1,1.3
|
Loading…
Reference in New Issue
Block a user