aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Selection.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Selection.cxx')
-rw-r--r--src/Selection.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/Selection.cxx b/src/Selection.cxx
index 7f2361f08..0675ceefe 100644
--- a/src/Selection.cxx
+++ b/src/Selection.cxx
@@ -392,20 +392,24 @@ void Selection::CommitTentative() noexcept {
tentativeMain = false;
}
-int Selection::CharacterInSelection(Sci::Position posCharacter) const noexcept {
+InSelection Selection::RangeType(size_t r) const noexcept {
+ return r == Main() ? InSelection::inMain : InSelection::inAdditional;
+}
+
+InSelection Selection::CharacterInSelection(Sci::Position posCharacter) const noexcept {
for (size_t i=0; i<ranges.size(); i++) {
if (ranges[i].ContainsCharacter(posCharacter))
- return i == mainRange ? 1 : 2;
+ return RangeType(i);
}
- return 0;
+ return InSelection::inNone;
}
-int Selection::InSelectionForEOL(Sci::Position pos) const noexcept {
+InSelection Selection::InSelectionForEOL(Sci::Position pos) const noexcept {
for (size_t i=0; i<ranges.size(); i++) {
if (!ranges[i].Empty() && (pos > ranges[i].Start().Position()) && (pos <= ranges[i].End().Position()))
- return i == mainRange ? 1 : 2;
+ return RangeType(i);
}
- return 0;
+ return InSelection::inNone;
}
Sci::Position Selection::VirtualSpaceFor(Sci::Position pos) const noexcept {