Using SciLexer.dll under Notepad++, although this issue should be platform-independent.
If INDIC_TEXTFORE is used as hovered style, and the indicated text range includes different sections drawn in different colors due to syntax highlighting, then only the section containing model.hoverIndicatorPos is highlighted, instead of the whole indicator range.
The reason seems to be, that the line is drawn section per section, and it is checked, if hoverIndicatorPos is within this section currently drawn instead of checking if it is in the indicator range.
After replacing the hovered check in EditView::DrawForeground, it worked for me.
Current:
const Indicator &indicator = vsDraw.indicators[deco->Indicator()];
const bool hover = indicator.IsDynamic() &&
((model.hoverIndicatorPos >= ts.start + posLineStart) &&
(model.hoverIndicatorPos <= ts.end() + posLineStart));
if (hover) {
New:
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) {
I counterfeited that new way from the DrawIndicator function.
The hole issue is part of the effort to use standard indicators for URL highlighting in Notepad++, see #2193 (solved), #2194 and #1371. Every improvement here would help a lot.
I attached a patch file. Please tell me, whether I used at least the correct patch file format, I created this with Beyond Compare. Thank you in advance.
Committed fix as [fc1c34] with minor formatting changes.
Related
Commit: [fc1c34]
Thank you very much again, I just tested the current snapshot with Notepad++, and it worked.
Committed fix as [fc1c34] with minor formatting changes.
Related
Commit: [fc1c34]