Fix select_sentence going past the end of the buffer

Fixes #3472
This commit is contained in:
Maxime Coste 2020-05-10 15:13:15 +10:00
parent 295a77b23a
commit 2104af0771
4 changed files with 5 additions and 1 deletions

View File

@ -515,7 +515,7 @@ select_sentence(const Context& context, const Selection& selection,
char prev = *(first-1); char prev = *(first-1);
if (not is_horizontal_blank(cur)) if (not is_horizontal_blank(cur))
saw_non_blank = true; saw_non_blank = true;
if (is_eol(prev) and is_eol(cur)) if (is_eol(prev) and is_eol(cur) and first + 1 != buffer.end())
{ {
++first; ++first;
break; break;

View File

@ -0,0 +1 @@
j[s

View File

@ -0,0 +1,2 @@
a

View File

@ -0,0 +1 @@
2.1,1.1