aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2020-07-16 08:03:19 +1000
committerNeil <nyamatongwe@gmail.com>2020-07-16 08:03:19 +1000
commit4fee1c0972ef24589e6d872b5cf4ad91f192d8d8 (patch)
treeffb9d01c1acc804826fe715defb5b215bfb0b078
parentc47a76507f5bfd812604504d3b0246fa45be799e (diff)
downloadscintilla-mirror-4fee1c0972ef24589e6d872b5cf4ad91f192d8d8.tar.gz
Backport: Add some const, constexpr.
Backport of changeset 8407:dfaa642a6c22.
-rw-r--r--src/Document.cxx2
-rw-r--r--src/EditView.cxx2
-rw-r--r--src/Editor.cxx2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index a9daf9339..eb8d764a3 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -2402,7 +2402,7 @@ StyledText Document::EOLAnnotationStyledText(Sci::Line line) const noexcept {
void Document::EOLAnnotationSetText(Sci::Line line, const char *text) {
if (line >= 0 && line < LinesTotal()) {
EOLAnnotations()->SetText(line, text);
- DocModification mh(SC_MOD_CHANGEEOLANNOTATION, LineStart(line),
+ const DocModification mh(SC_MOD_CHANGEEOLANNOTATION, LineStart(line),
0, 0, 0, line);
NotifyModified(mh);
}
diff --git a/src/EditView.cxx b/src/EditView.cxx
index b7a8238da..b90dd05b8 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -985,7 +985,7 @@ void EditView::DrawEOL(Surface *surface, const EditModel &model, const ViewStyle
rcSegment.left = rcLine.left;
rcSegment.right = rcLine.right;
- bool drawEOLAnnotationStyledText = (vsDraw.eolAnnotationVisible != EOLANNOTATION_HIDDEN) && model.pdoc->EOLAnnotationStyledText(line).text;
+ const bool drawEOLAnnotationStyledText = (vsDraw.eolAnnotationVisible != EOLANNOTATION_HIDDEN) && model.pdoc->EOLAnnotationStyledText(line).text;
const bool fillRemainder = (!lastSubLine || (!model.GetFoldDisplayText(line) && !drawEOLAnnotationStyledText));
if (fillRemainder) {
// Fill the remainder of the line
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 630a6f69e..878ecc24f 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1541,7 +1541,7 @@ bool Editor::WrapLines(WrapScope ws) {
}
} else if (ws == WrapScope::wsIdle) {
// Try to keep time taken by wrapping reasonable so interaction remains smooth.
- const double secondsAllowed = 0.01;
+ constexpr double secondsAllowed = 0.01;
const Sci::Line linesInAllowedTime = Sci::clamp(
static_cast<Sci::Line>(secondsAllowed / durationWrapOneLine.Duration()),
LinesOnScreen() + 50, static_cast<Sci::Line>(0x10000));