diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 10 | ||||
-rw-r--r-- | src/Selection.cxx | 4 | ||||
-rw-r--r-- | src/Selection.h | 1 |
3 files changed, 15 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 3085bd6ec..317b3f4a6 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -8289,6 +8289,16 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_GETADDITIONALCARETFORE: return vs.additionalCaretColour.desired.AsLong(); + case SCI_ROTATESELECTION: + sel.RotateMain(); + InvalidateSelection(sel.RangeMain(), true); + break; + + case SCI_SWAPMAINANCHORCARET: + InvalidateSelection(sel.RangeMain()); + sel.RangeMain() = SelectionRange(sel.RangeMain().anchor, sel.RangeMain().caret); + break; + default: return DefWndProc(iMessage, wParam, lParam); } diff --git a/src/Selection.cxx b/src/Selection.cxx index 1ea5f1bbe..246cfe709 100644 --- a/src/Selection.cxx +++ b/src/Selection.cxx @@ -328,3 +328,7 @@ void Selection::RemoveDuplicates() { } } +void Selection::RotateMain() { + mainRange = (mainRange + 1) % ranges.size(); +} + diff --git a/src/Selection.h b/src/Selection.h index 2c4ee120b..ff13f2130 100644 --- a/src/Selection.h +++ b/src/Selection.h @@ -156,6 +156,7 @@ public: int VirtualSpaceFor(int pos) const; void Clear(); void RemoveDuplicates(); + void RotateMain(); }; #ifdef SCI_NAMESPACE |