Do not go backward to when selecting to end of line from the end of line

Fixes #699
This commit is contained in:
Maxime Coste 2016-06-22 19:56:40 +01:00
parent c032306e04
commit 532ae5a1a6
4 changed files with 5 additions and 0 deletions

View File

@ -121,6 +121,8 @@ Selection select_to_line_end(const Buffer& buffer, const Selection& selection)
LineCount line = begin.line;
ByteCoord end = utf8::previous(buffer.iterator_at({line, buffer[line].length() - 1}),
buffer.iterator_at(line)).coord();
if (end < begin) // Do not go backward when cursor is on eol
end = begin;
return target_eol({only_move ? end : begin, end});
}

View File

@ -0,0 +1 @@
x;<a-l>

View File

@ -0,0 +1 @@
my line

View File

@ -0,0 +1 @@
1.8,1.8