diff options
author | Neil <nyamatongwe@gmail.com> | 2014-07-07 23:51:04 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2014-07-07 23:51:04 +1000 |
commit | 43ca027041c2e06ddfa6d28ccb7f17a35a08d6cf (patch) | |
tree | 317424bc8009361a68b32466159cd32a2160f138 /src/Selection.cxx | |
parent | 9206c1ca0542c9f34d3374dd2f8bd7443de9fae2 (diff) | |
download | scintilla-mirror-43ca027041c2e06ddfa6d28ccb7f17a35a08d6cf.tar.gz |
Fix bug where too many characters may be deleted when a rectangular selection is
deleted.
Diffstat (limited to 'src/Selection.cxx')
-rw-r--r-- | src/Selection.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Selection.cxx b/src/Selection.cxx index b46dca890..52ed5774e 100644 --- a/src/Selection.cxx +++ b/src/Selection.cxx @@ -81,6 +81,11 @@ int SelectionRange::Length() const { } } +void SelectionRange::MoveForInsertDelete(bool insertion, int startChange, int length) { + caret.MoveForInsertDelete(insertion, startChange, length); + anchor.MoveForInsertDelete(insertion, startChange, length); +} + bool SelectionRange::Contains(int pos) const { if (anchor > caret) return (pos >= caret.Position()) && (pos <= anchor.Position()); @@ -283,9 +288,11 @@ int Selection::Length() const { void Selection::MovePositions(bool insertion, int startChange, int length) { for (size_t i=0; i<ranges.size(); i++) { - ranges[i].caret.MoveForInsertDelete(insertion, startChange, length); - ranges[i].anchor.MoveForInsertDelete(insertion, startChange, length); + ranges[i].MoveForInsertDelete(insertion, startChange, length); } + if (selType == selRectangle) { + rangeRectangular.MoveForInsertDelete(insertion, startChange, length); + } } void Selection::TrimSelection(SelectionRange range) { |