From 43ca027041c2e06ddfa6d28ccb7f17a35a08d6cf Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 7 Jul 2014 23:51:04 +1000 Subject: Fix bug where too many characters may be deleted when a rectangular selection is deleted. --- src/Editor.cxx | 1 + src/Selection.cxx | 11 +++++++++-- src/Selection.h | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index db0aecf43..d3e5f3090 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4321,6 +4321,7 @@ void Editor::DelChar() { } void Editor::DelCharBack(bool allowLineStartDeletion) { + RefreshStyleData(); if (!sel.IsRectangular()) FilterSelections(); if (sel.IsRectangular()) 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