diff options
author | Neil <nyamatongwe@gmail.com> | 2015-12-04 10:23:09 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2015-12-04 10:23:09 +1100 |
commit | 7a59a0b86002f9a0fafdd48d77a2a950f7d2b3c2 (patch) | |
tree | 0babdccf766e62578a80418a1b2de858b2fece16 /src/EditView.cxx | |
parent | 4986ca35d6cb5c51605001f9dda39c4255067a45 (diff) | |
download | scintilla-mirror-7a59a0b86002f9a0fafdd48d77a2a950f7d2b3c2.tar.gz |
Bug [#1784]. Highlight whole run for hover indicator when wrapped.
Less efficient now as redraws all text when hover position changes.
Diffstat (limited to 'src/EditView.cxx')
-rw-r--r-- | src/EditView.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx index 692740b7c..db6b34fe0 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -986,11 +986,10 @@ static void DrawIndicators(Surface *surface, const EditModel &model, const ViewS startPos = deco->rs.EndRun(startPos); } while ((startPos < posLineEnd) && (deco->rs.ValueAt(startPos))) { - int endPos = deco->rs.EndRun(startPos); - if (endPos > posLineEnd) - endPos = posLineEnd; + const Range rangeRun(deco->rs.StartRun(startPos), deco->rs.EndRun(startPos)); + const int endPos = std::min(rangeRun.end, posLineEnd); const bool hover = vsDraw.indicators[deco->indicator].IsDynamic() && - ((hoverIndicatorPos >= startPos) && (hoverIndicatorPos <= endPos)); + rangeRun.ContainsCharacter(hoverIndicatorPos); const int value = deco->rs.ValueAt(startPos); Indicator::DrawState drawState = hover ? Indicator::drawHover : Indicator::drawNormal; DrawIndicator(deco->indicator, startPos - posLineStart, endPos - posLineStart, |