diff options
author | Neil <nyamatongwe@gmail.com> | 2025-02-05 20:19:18 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2025-02-05 20:19:18 +1100 |
commit | f8d3a96296b898cbca5faf1e326b3a3b0d162672 (patch) | |
tree | cb0d392233fa299687701b5a47a55855db909285 /src/Selection.cxx | |
parent | ac415de8e8457471528908f73996be78613c4620 (diff) | |
download | scintilla-mirror-f8d3a96296b898cbca5faf1e326b3a3b0d162672.tar.gz |
Use new SelectionSegment constructor and SelectionRange::AsSegment to simplify
code.
Diffstat (limited to 'src/Selection.cxx')
-rw-r--r-- | src/Selection.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Selection.cxx b/src/Selection.cxx index 20fb1efca..527a9d29a 100644 --- a/src/Selection.cxx +++ b/src/Selection.cxx @@ -327,7 +327,7 @@ SelectionRange Selection::RectangularCopy() const noexcept { SelectionSegment Selection::Limits() const noexcept { PLATFORM_ASSERT(!ranges.empty()); - SelectionSegment sr(ranges[0].anchor, ranges[0].caret); + SelectionSegment sr = ranges[0].AsSegment(); for (size_t i=1; i<ranges.size(); i++) { sr.Extend(ranges[i].anchor); sr.Extend(ranges[i].caret); @@ -339,7 +339,7 @@ SelectionSegment Selection::LimitsForRectangularElseMain() const noexcept { if (IsRectangular()) { return Limits(); } else { - return SelectionSegment(ranges[mainRange].caret, ranges[mainRange].anchor); + return ranges[mainRange].AsSegment(); } } |