Fix select_to_reverse to correctly handle the first character of the buffer

Fixes #809
This commit is contained in:
Maxime Coste 2016-09-19 09:20:55 +01:00
parent 396b71ecc2
commit fafde8655b
4 changed files with 5 additions and 2 deletions

View File

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

View File

@ -0,0 +1 @@
<a-f>f

View File

@ -0,0 +1 @@
fooba%(r)

View File

@ -0,0 +1 @@
foobar