aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/EditView.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/EditView.cxx')
-rw-r--r--src/EditView.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx
index d59f99eb2..a40c6c3b8 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -711,7 +711,7 @@ void EditView::UpdateBidiData(const EditModel &model, const ViewStyle &vstyle, L
ll->bidiData->stylesFonts[ll->numCharsInLine].reset();
for (int charsInLine = 0; charsInLine < ll->numCharsInLine; charsInLine++) {
- const int charWidth = UTF8DrawBytes(reinterpret_cast<unsigned char *>(&ll->chars[charsInLine]), ll->numCharsInLine - charsInLine);
+ const int charWidth = UTF8DrawBytes(&ll->chars[charsInLine], ll->numCharsInLine - charsInLine);
const Representation *repr = model.reprs.RepresentationFromCharacter(std::string_view(&ll->chars[charsInLine], charWidth));
ll->bidiData->widthReprs[charsInLine] = 0.0f;
@@ -1328,7 +1328,7 @@ static void DrawIndicators(Surface *surface, const EditModel &model, const ViewS
if (FlagSet(model.changeHistoryOption, ChangeHistoryOption::Indicators)) {
// Draw editions
- const int indexHistory = static_cast<int>(IndicatorNumbers::HistoryRevertedToOriginInsertion);
+ constexpr int indexHistory = static_cast<int>(IndicatorNumbers::HistoryRevertedToOriginInsertion);
{
// Draw insertions
Sci::Position startPos = posLineStart + lineStart;
@@ -1815,7 +1815,9 @@ void EditView::DrawCarets(Surface *surface, const EditModel &model, const ViewSt
}
}
-static void DrawWrapIndentAndMarker(Surface *surface, const ViewStyle &vsDraw, const LineLayout *ll,
+namespace {
+
+void DrawWrapIndentAndMarker(Surface *surface, const ViewStyle &vsDraw, const LineLayout *ll,
int xStart, PRectangle rcLine, std::optional<ColourRGBA> background, DrawWrapMarkerFn customDrawWrapMarker,
bool caretActive) {
// default bgnd here..
@@ -1855,7 +1857,7 @@ static void DrawWrapIndentAndMarker(Surface *surface, const ViewStyle &vsDraw, c
// such that, if the caret is inside the main selection, the beginning or end of that selection
// is at the end of a text segment.
// This function should only be called if iDoc is within the main selection.
-static InSelection CharacterInCursesSelection(Sci::Position iDoc, const EditModel &model, const ViewStyle &vsDraw) {
+InSelection CharacterInCursesSelection(Sci::Position iDoc, const EditModel &model, const ViewStyle &vsDraw) noexcept {
const SelectionPosition &posCaret = model.sel.RangeMain().caret;
const bool caretAtStart = posCaret < model.sel.RangeMain().anchor && posCaret.Position() == iDoc;
const bool caretAtEnd = posCaret > model.sel.RangeMain().anchor &&
@@ -1864,6 +1866,8 @@ static InSelection CharacterInCursesSelection(Sci::Position iDoc, const EditMode
return (caretAtStart || caretAtEnd) ? InSelection::inNone : InSelection::inMain;
}
+}
+
void EditView::DrawBackground(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
PRectangle rcLine, Range lineRange, Sci::Position posLineStart, int xStart,
int subLine, std::optional<ColourRGBA> background) const {