aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2023-10-26 13:44:13 +1100
committerNeil <nyamatongwe@gmail.com>2023-10-26 13:44:13 +1100
commit8f42bb51d6445602027d8c68d6c6f225f6536c68 (patch)
tree076c344e247f686086090738356df63b60f0056d /src/Editor.cxx
parentfdbb5c9273a8f25f86f4113b837926f883083b23 (diff)
downloadscintilla-mirror-8f42bb51d6445602027d8c68d6c6f225f6536c68.tar.gz
Implement LineEnd method in CellBuffer as it is a basic function and only uses
CellBuffer fields. Declare LineEnd noexcept as it should never throw and that allows methods calling it to also be noexcept. Call LineEndPosition to simplify Editor::LineSelectionRange.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 80436fd21..dd2fc7e98 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -625,13 +625,11 @@ SelectionRange Editor::LineSelectionRange(SelectionPosition currentPos_, Selecti
if (currentPos_ > anchor_) {
anchor_ = SelectionPosition(
pdoc->LineStart(pdoc->LineFromPosition(anchor_.Position())));
- currentPos_ = SelectionPosition(
- pdoc->LineEnd(pdoc->LineFromPosition(currentPos_.Position())));
+ currentPos_ = SelectionPosition(pdoc->LineEndPosition(currentPos_.Position()));
} else {
currentPos_ = SelectionPosition(
pdoc->LineStart(pdoc->LineFromPosition(currentPos_.Position())));
- anchor_ = SelectionPosition(
- pdoc->LineEnd(pdoc->LineFromPosition(anchor_.Position())));
+ anchor_ = SelectionPosition(pdoc->LineEndPosition(anchor_.Position()));
}
return SelectionRange(currentPos_, anchor_);
}