aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/EditView.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/EditView.cxx')
-rw-r--r--src/EditView.cxx25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx
index e6cd8fcfe..3bca3b58b 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -963,14 +963,23 @@ void EditView::DrawEOL(Surface *surface, const EditModel &model, const ViewStyle
}
static void DrawIndicator(int indicNum, int startPos, int endPos, Surface *surface, const ViewStyle &vsDraw,
- const LineLayout *ll, int xStart, PRectangle rcLine, int subLine, Indicator::DrawState drawState, int value) {
+ const LineLayout *ll, int xStart, PRectangle rcLine, int secondCharacter, int subLine, Indicator::DrawState drawState, int value) {
const XYPOSITION subLineStart = ll->positions[ll->LineStart(subLine)];
PRectangle rcIndic(
ll->positions[startPos] + xStart - subLineStart,
rcLine.top + vsDraw.maxAscent,
ll->positions[endPos] + xStart - subLineStart,
rcLine.top + vsDraw.maxAscent + 3);
- vsDraw.indicators[indicNum].Draw(surface, rcIndic, rcLine, drawState, value);
+ PRectangle rcFirstCharacter = rcIndic;
+ // Allow full descent space for character indicators
+ rcFirstCharacter.bottom = rcLine.top + vsDraw.maxAscent + vsDraw.maxDescent;
+ if (secondCharacter >= 0) {
+ rcFirstCharacter.right = ll->positions[secondCharacter] + xStart - subLineStart;
+ } else {
+ // Indicator continued from earlier line so make an empty box and don't draw
+ rcFirstCharacter.right = rcFirstCharacter.left;
+ }
+ vsDraw.indicators[indicNum].Draw(surface, rcIndic, rcLine, rcFirstCharacter, drawState, value);
}
static void DrawIndicators(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
@@ -993,8 +1002,9 @@ static void DrawIndicators(Surface *surface, const EditModel &model, const ViewS
rangeRun.ContainsCharacter(hoverIndicatorPos);
const int value = deco->rs.ValueAt(startPos);
Indicator::DrawState drawState = hover ? Indicator::drawHover : Indicator::drawNormal;
+ const int posSecond = model.pdoc->MovePositionOutsideChar(rangeRun.First() + 1, 1);
DrawIndicator(deco->indicator, startPos - posLineStart, endPos - posLineStart,
- surface, vsDraw, ll, xStart, rcLine, subLine, drawState, value);
+ surface, vsDraw, ll, xStart, rcLine, posSecond - posLineStart, subLine, drawState, value);
startPos = endPos;
if (!deco->rs.ValueAt(startPos)) {
startPos = deco->rs.EndRun(startPos);
@@ -1012,13 +1022,15 @@ static void DrawIndicators(Surface *surface, const EditModel &model, const ViewS
if (rangeLine.ContainsCharacter(model.braces[0])) {
int braceOffset = model.braces[0] - posLineStart;
if (braceOffset < ll->numCharsInLine) {
- DrawIndicator(braceIndicator, braceOffset, braceOffset + 1, surface, vsDraw, ll, xStart, rcLine, subLine, Indicator::drawNormal, 1);
+ const int secondOffset = model.pdoc->MovePositionOutsideChar(model.braces[0] + 1, 1) - posLineStart;
+ DrawIndicator(braceIndicator, braceOffset, braceOffset + 1, surface, vsDraw, ll, xStart, rcLine, secondOffset, subLine, Indicator::drawNormal, 1);
}
}
if (rangeLine.ContainsCharacter(model.braces[1])) {
int braceOffset = model.braces[1] - posLineStart;
if (braceOffset < ll->numCharsInLine) {
- DrawIndicator(braceIndicator, braceOffset, braceOffset + 1, surface, vsDraw, ll, xStart, rcLine, subLine, Indicator::drawNormal, 1);
+ const int secondOffset = model.pdoc->MovePositionOutsideChar(model.braces[1] + 1, 1) - posLineStart;
+ DrawIndicator(braceIndicator, braceOffset, braceOffset + 1, surface, vsDraw, ll, xStart, rcLine, secondOffset, subLine, Indicator::drawNormal, 1);
}
}
}
@@ -1878,7 +1890,8 @@ void EditView::PaintText(Surface *surfaceWindow, const EditModel &model, PRectan
ll->SetBracesHighlight(rangeLine, model.braces, static_cast<char>(model.bracesMatchStyle),
static_cast<int>(model.highlightGuideColumn * vsDraw.spaceWidth), bracesIgnoreStyle);
- if (leftTextOverlap && bufferedDraw) {
+ if (leftTextOverlap && (bufferedDraw || ((phasesDraw < phasesMultiple) && (*it & drawBack)))) {
+ // Clear the left margin
PRectangle rcSpacer = rcLine;
rcSpacer.right = rcSpacer.left;
rcSpacer.left -= 1;