aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Selection.cxx
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
commitab36224e033e1772c604cad2ab8c5f831f24357f (patch)
tree252744732d806ed96bd3f1e98a54237bc958dc90 /src/Selection.cxx
parent22eee409c31068626864be47848673c73d31f413 (diff)
downloadscintilla-mirror-ab36224e033e1772c604cad2ab8c5f831f24357f.tar.gz
Backport: 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. Backport of changeset 7775:a9a0edc8f2f2.
Diffstat (limited to 'src/Selection.cxx')
-rw-r--r--src/Selection.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Selection.cxx b/src/Selection.cxx
index 47aba5c31..fbdd375c6 100644
--- a/src/Selection.cxx
+++ b/src/Selection.cxx
@@ -95,8 +95,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);