I don't figured out why the same changes not works for SciTE (by hardcoded caretLine.subLine = true; in ViewStyle::Init()).
The default (on layer 0) is to change the background colour of the line in ViewStyle::Background when its the caret line. This uses LineLayout::containsCaret which is set in EditView::PaintText without checking whether its in the subline.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logically, LineLayout should be const for drawing and changing it to reflect local context is a kludge. Perhaps its time to move containsCaret, hotspot, xHighlightGuide and potentially others into a new argument to drawing. The difficult case is brace highlighting as that patches styles which can then be treated uniformly.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If this is implemented, it should be an option.
Since I do not use line highlighting, I will not work on this feature myself.
Same as https://sourceforge.net/p/scintilla/feature-requests/1245/
Attachment contains an implementation that works for Notepad2 (can be toggled from menu View -> Highlight Current LIne -> Highlight Subline), https://github.com/zufuliu/notepad2/commit/405b8218cbc820e455618484edad40303ddc0edd
I don't figured out why the same changes not works for SciTE (by hardcoded
caretLine.subLine = true;inViewStyle::Init()).The default (on layer 0) is to change the background colour of the line in
ViewStyle::Backgroundwhen its the caret line. This usesLineLayout::containsCaretwhich is set inEditView::PaintTextwithout checking whether its in the subline.Logically,
LineLayoutshould be const for drawing and changing it to reflect local context is a kludge. Perhaps its time to movecontainsCaret,hotspot,xHighlightGuideand potentially others into a new argument to drawing. The difficult case is brace highlighting as that patchesstyleswhich can then be treated uniformly.Patch to remove the hotspot field, as it only used inside DrawBackground() and DrawForeground(), it can be removed completely.
Committed with minor edits as [46ec6c].
Related
Commit: [46ec6c]
Move subline checking into
EditView::PaintText()indeed fixed highlighting bug for base layer + background color.The change seems will not affects other usages of
containsCaret.Committed with minor edits as [d72368].
Related
Commit: [d72368]