aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Selection.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2023-11-05 22:11:26 +1100
committerNeil <nyamatongwe@gmail.com>2023-11-05 22:11:26 +1100
commit26b60d88b6d848f3ba55ca046852e079be5fe3c6 (patch)
treebaf6523ea5e4f2d5adfb021def287a6858802b23 /src/Selection.cxx
parenta3dd1952c420158febe7a11d596ba3f402eb17ab (diff)
downloadscintilla-mirror-26b60d88b6d848f3ba55ca046852e079be5fe3c6.tar.gz
Add SCI_SELECTIONFROMPOINT for modifying multiple selections.
Diffstat (limited to 'src/Selection.cxx')
-rw-r--r--src/Selection.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Selection.cxx b/src/Selection.cxx
index fbdc474eb..53559e329 100644
--- a/src/Selection.cxx
+++ b/src/Selection.cxx
@@ -123,6 +123,13 @@ bool SelectionRange::ContainsCharacter(Sci::Position posCharacter) const noexcep
return (posCharacter >= anchor.Position()) && (posCharacter < caret.Position());
}
+bool SelectionRange::ContainsCharacter(SelectionPosition spCharacter) const noexcept {
+ if (anchor > caret)
+ return (spCharacter >= caret) && (spCharacter < anchor);
+ else
+ return (spCharacter >= anchor) && (spCharacter < caret);
+}
+
SelectionSegment SelectionRange::Intersect(SelectionSegment check) const noexcept {
const SelectionSegment inOrder(caret, anchor);
if ((inOrder.start <= check.end) || (inOrder.end >= check.start)) {