diff options
author | nyamatongwe <unknown> | 2010-11-21 07:16:01 +1100 |
---|---|---|
committer | nyamatongwe <unknown> | 2010-11-21 07:16:01 +1100 |
commit | 9ff23b64faa9654d6978494f65afe9c09932840a (patch) | |
tree | 3d2fbf4e78d848c021b6bc0894f6a6107bd0b7c1 /src | |
parent | 9352b0b27b48261989d908380be8f7fa91facdb9 (diff) | |
download | scintilla-mirror-9ff23b64faa9654d6978494f65afe9c09932840a.tar.gz |
Speed up creating large rectangular selections.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 2 | ||||
-rw-r--r-- | src/Selection.cxx | 5 | ||||
-rw-r--r-- | src/Selection.h | 1 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 01415ec88..6cf8d7490 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -708,7 +708,7 @@ void Editor::SetRectangularRange() { if (line == lineAnchor) sel.SetSelection(range); else - sel.AddSelection(range); + sel.AddSelectionWithoutTrim(range); } } } diff --git a/src/Selection.cxx b/src/Selection.cxx index 6f3267dfa..48add617c 100644 --- a/src/Selection.cxx +++ b/src/Selection.cxx @@ -291,6 +291,11 @@ void Selection::AddSelection(SelectionRange range) { mainRange = ranges.size() - 1; } +void Selection::AddSelectionWithoutTrim(SelectionRange range) { + ranges.push_back(range); + mainRange = ranges.size() - 1; +} + void Selection::TentativeSelection(SelectionRange range) { if (!tentativeMain) { rangesSaved = ranges; diff --git a/src/Selection.h b/src/Selection.h index bb2926642..75f02f6cd 100644 --- a/src/Selection.h +++ b/src/Selection.h @@ -166,6 +166,7 @@ public: void TrimSelection(SelectionRange range); void SetSelection(SelectionRange range); void AddSelection(SelectionRange range); + void AddSelectionWithoutTrim(SelectionRange range); void TentativeSelection(SelectionRange range); void CommitTentative(); int CharacterInSelection(int posCharacter) const; |