Do not go backward to when selecting to end of line from the end of line
Fixes #699
This commit is contained in:
parent
c032306e04
commit
532ae5a1a6
|
@ -121,6 +121,8 @@ Selection select_to_line_end(const Buffer& buffer, const Selection& selection)
|
||||||
LineCount line = begin.line;
|
LineCount line = begin.line;
|
||||||
ByteCoord end = utf8::previous(buffer.iterator_at({line, buffer[line].length() - 1}),
|
ByteCoord end = utf8::previous(buffer.iterator_at({line, buffer[line].length() - 1}),
|
||||||
buffer.iterator_at(line)).coord();
|
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});
|
return target_eol({only_move ? end : begin, end});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
test/regression/699-to-eol-from-eol/cmd
Normal file
1
test/regression/699-to-eol-from-eol/cmd
Normal file
|
@ -0,0 +1 @@
|
||||||
|
x;<a-l>
|
1
test/regression/699-to-eol-from-eol/in
Normal file
1
test/regression/699-to-eol-from-eol/in
Normal file
|
@ -0,0 +1 @@
|
||||||
|
my line
|
1
test/regression/699-to-eol-from-eol/state
Normal file
1
test/regression/699-to-eol-from-eol/state
Normal file
|
@ -0,0 +1 @@
|
||||||
|
1.8,1.8
|
Loading…
Reference in New Issue
Block a user