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;
|
||||
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);
|
||||
|
|
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