aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2019-11-26 09:09:26 +1100
committerNeil <nyamatongwe@gmail.com>2019-11-26 09:09:26 +1100
commitb08335168f56212c7d9ae9f236f8fac0746ba090 (patch)
tree36303cf702a28930e0737511dead85440e630a4f /src
parent86a71cac683e04357bf689817053b60c6b5798d1 (diff)
downloadscintilla-mirror-b08335168f56212c7d9ae9f236f8fac0746ba090.tar.gz
Bug [#2140]. Fix where anchor and caret differ only in amount of virtual space
so one was considered start and was moved for an insertion at that position. This could flip the order of the positions or change the length of the selection.
Diffstat (limited to 'src')
-rw-r--r--src/Selection.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Selection.cxx b/src/Selection.cxx
index e47ace127..4a397b4aa 100644
--- a/src/Selection.cxx
+++ b/src/Selection.cxx
@@ -96,8 +96,8 @@ void SelectionRange::MoveForInsertDelete(bool insertion, Sci::Position startChan
// which position is the start and pass this into
// SelectionPosition::MoveForInsertDelete.
// There isn't any reason to move an empty selection so don't move it.
- const bool caretStart = caret < anchor;
- const bool anchorStart = anchor < caret;
+ const bool caretStart = caret.Position() < anchor.Position();
+ const bool anchorStart = anchor.Position() < caret.Position();
caret.MoveForInsertDelete(insertion, startChange, length, caretStart);
anchor.MoveForInsertDelete(insertion, startChange, length, anchorStart);