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 | ee6a5a8ecf0498fd2bc48803335f858eccfece69 (patch) | |
tree | 46470b53c6173a9b3bfce1166ed1021768ea753c /src/Selection.cxx | |
parent | 8b5aaf5c4aca7f6369adbba839e4c7366e9bf8a3 (diff) | |
download | scintilla-mirror-ee6a5a8ecf0498fd2bc48803335f858eccfece69.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) { |