Fix select_to_reverse to correctly handle the first character of the buffer
Fixes #809
This commit is contained in:
parent
396b71ecc2
commit
fafde8655b
|
@ -229,8 +229,8 @@ Selection select_to_reverse(const Buffer& buffer, const Selection& selection,
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
--end;
|
--end;
|
||||||
skip_while_reverse(end, buffer.begin(), [c](Codepoint cur) { return cur != c; });
|
if (skip_while_reverse(end, buffer.begin(),
|
||||||
if (end == buffer.begin())
|
[c](Codepoint cur) { return cur != c; }))
|
||||||
return selection;
|
return selection;
|
||||||
}
|
}
|
||||||
while (--count > 0);
|
while (--count > 0);
|
||||||
|
|
1
test/regression/809-alt-f-t-to-first-char/cmd
Normal file
1
test/regression/809-alt-f-t-to-first-char/cmd
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<a-f>f
|
1
test/regression/809-alt-f-t-to-first-char/in
Normal file
1
test/regression/809-alt-f-t-to-first-char/in
Normal file
|
@ -0,0 +1 @@
|
||||||
|
fooba%(r)
|
1
test/regression/809-alt-f-t-to-first-char/selections
Normal file
1
test/regression/809-alt-f-t-to-first-char/selections
Normal file
|
@ -0,0 +1 @@
|
||||||
|
foobar
|
Loading…
Reference in New Issue
Block a user