aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoruhf7 <unknown>2020-08-26 23:03:13 +1000
committeruhf7 <unknown>2020-08-26 23:03:13 +1000
commita4932dda62685856670a782c92d7eebc8afb8bf2 (patch)
treee8ba2444f198f26fae3fa1be208843b22fd56a11
parent24ba9ee47bb8535f44fbaa7d36f18cfda53eaf44 (diff)
downloadscintilla-mirror-a4932dda62685856670a782c92d7eebc8afb8bf2.tar.gz
Bug [#2199]. Fixed bug where a hovered INDIC_TEXTFORE indicator was not applying
the hover colour to the whole range.
-rw-r--r--doc/ScintillaHistory.html5
-rw-r--r--src/EditView.cxx9
2 files changed, 11 insertions, 3 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index dc9311761..0b67ba6b4 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -606,6 +606,11 @@
<a href="https://sourceforge.net/p/scintilla/bugs/2193/">Bug #2193</a>.
</li>
<li>
+ Fixed bug where a hovered INDIC_TEXTFORE indicator was not applying the hover
+ colour to the whole range.
+ <a href="https://sourceforge.net/p/scintilla/bugs/2199/">Bug #2199</a>.
+ </li>
+ <li>
Fixed bug where gradient indicators were not showing hovered appearance.
</li>
<li>
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 505530054..72f219fae 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -1896,9 +1896,12 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi
const int indicatorValue = deco->ValueAt(ts.start + posLineStart);
if (indicatorValue) {
const Indicator &indicator = vsDraw.indicators[deco->Indicator()];
- const bool hover = indicator.IsDynamic() &&
- ((model.hoverIndicatorPos >= ts.start + posLineStart) &&
- (model.hoverIndicatorPos <= ts.end() + posLineStart));
+ bool hover = false;
+ if (indicator.IsDynamic()) {
+ const Sci::Position startPos = ts.start + posLineStart;
+ const Range rangeRun(deco->StartRun(startPos), deco->EndRun(startPos));
+ hover = rangeRun.ContainsCharacter(model.hoverIndicatorPos);
+ }
if (hover) {
if (indicator.sacHover.style == INDIC_TEXTFORE) {
textFore = indicator.sacHover.fore;