aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Selection.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2009-07-30 08:29:43 +0000
committernyamatongwe <unknown>2009-07-30 08:29:43 +0000
commitb8a801fe139ea37cba36dc7b724e03495cf847e9 (patch)
tree089cc73c6396c1d45e59dc3c30ec5633c1857d11 /src/Selection.cxx
parent5102901f8df958fe60fdb0a6d3354ad52bd955c2 (diff)
downloadscintilla-mirror-b8a801fe139ea37cba36dc7b724e03495cf847e9.tar.gz
When using Ctrl+Drag for multiple selection when previous selections
dragged over but then that area is deselected, reveal the previous selections again. This allows the user to undo some bad effects when the mouse moves further than wanted.
Diffstat (limited to 'src/Selection.cxx')
-rw-r--r--src/Selection.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/Selection.cxx b/src/Selection.cxx
index 246cfe709..b44d4e96c 100644
--- a/src/Selection.cxx
+++ b/src/Selection.cxx
@@ -156,7 +156,7 @@ void SelectionRange::MinimizeVirtualSpace() {
}
}
-Selection::Selection() : mainRange(0), moveExtends(false), selType(selStream) {
+Selection::Selection() : mainRange(0), moveExtends(false), selType(selStream), tentativeMain(false) {
AddSelection(SelectionPosition(0));
}
@@ -270,8 +270,19 @@ void Selection::AddSelection(SelectionRange range) {
mainRange = ranges.size() - 1;
}
-void Selection::AddSelection(SelectionPosition spPos) {
- AddSelection(SelectionRange(spPos, spPos));
+void Selection::TentativeSelection(SelectionRange range) {
+ if (!tentativeMain) {
+ rangesSaved = ranges;
+ }
+ ranges = rangesSaved;
+ AddSelection(range);
+ TrimSelection(ranges[mainRange]);
+ tentativeMain = true;
+}
+
+void Selection::CommitTentative() {
+ rangesSaved.clear();
+ tentativeMain = false;
}
int Selection::CharacterInSelection(int posCharacter) const {