aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2020-02-29 09:11:59 +1100
committerNeil <nyamatongwe@gmail.com>2020-02-29 09:11:59 +1100
commit1f65de4a7d348ff5018c76ad8067a4b360047956 (patch)
tree9e7c74279e50dd9f6fe037315f3e33dcc4854035 /src/Editor.cxx
parent95ecd4d0e34290dbd054a8710a255a9e93347c5f (diff)
downloadscintilla-mirror-1f65de4a7d348ff5018c76ad8067a4b360047956.tar.gz
Add const and noexcept where they make sense.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index d8d231911..2709e3d3d 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -565,7 +565,7 @@ Sci::Position Editor::CurrentPosition() const {
return sel.MainCaret();
}
-bool Editor::SelectionEmpty() const {
+bool Editor::SelectionEmpty() const noexcept {
return sel.Empty();
}
@@ -789,7 +789,7 @@ void Editor::MultipleSelectAdd(AddNumber addNumber) {
}
}
-bool Editor::RangeContainsProtected(Sci::Position start, Sci::Position end) const {
+bool Editor::RangeContainsProtected(Sci::Position start, Sci::Position end) const noexcept {
if (vs.ProtectionActive()) {
if (start > end) {
const Sci::Position t = start;
@@ -804,7 +804,7 @@ bool Editor::RangeContainsProtected(Sci::Position start, Sci::Position end) cons
return false;
}
-bool Editor::SelectionContainsProtected() {
+bool Editor::SelectionContainsProtected() const {
for (size_t r=0; r<sel.Count(); r++) {
if (RangeContainsProtected(sel.Range(r).Start().Position(),
sel.Range(r).End().Position())) {
@@ -1924,7 +1924,7 @@ void Editor::InsertCharacter(std::string_view sv, CharacterSource charSource) {
}
// Order selections by position in document.
std::sort(selPtrs.begin(), selPtrs.end(),
- [](const SelectionRange *a, const SelectionRange *b) {return *a < *b;});
+ [](const SelectionRange *a, const SelectionRange *b) noexcept {return *a < *b;});
// Loop in reverse to avoid disturbing positions of selections yet to be processed.
for (std::vector<SelectionRange *>::reverse_iterator rit = selPtrs.rbegin();