Here's patch which adds SC_MARK_BACKFORE.
SC_MARK_BACKFORE changes the background, foreground and caret colours of the line only and is like a SC_MARK_BACKGROUND which also does the foreground color.
It was actually added a long time ago by Jordan Russell for Inno Setup and I recently updated this to the lastest version of Scintilla. In Inno Setup this marker symbol is used to mark special lines such as error lines and debug step lines.
The patch includes updates of Scintilla.iface and ScintillaDoc.html.
https://patch-diff.githubusercontent.com/raw/jrsoftware/scintilla/pull/5.diff
https://patch-diff.githubusercontent.com/raw/jrsoftware/scintilla/pull/5.patch
https://github.com/jrsoftware/scintilla/pull/5/files
Jordan just pointed out to me that you and he already had a discussion about this a long time ago. See https://groups.google.com/g/scintilla-interest/c/Rf-n4mVqF-c/m/9Z4OQ2UXBBwJ
If you still think it's better to have a SC_MARK_FOREGROUND (or SC_MARK_TEXTFORE?) instead of this please let me know and I will change it.
An
INDIC_TEXTFORE
indicator can currently be used to force a text foreground colour over a range and that could achieve much of the desired effect here.While not certain, I'm going to agree with my mailing list message that there could be a better implementation. When the background is changed enough to make text difficult to read, other aspects like the selection will likely also be difficult to see. Tying the caret colour to an override text colour limits flexibility and is likely to result in requests for even more APIs.
Separate
SC_MARK_FOREGROUND
andSC_MARK_CARET
marker 'symbols' may be reasonable.Grouping 'atomized' attributes into a single macro attribute to allow setting multiple visuals in one operation has been an issue for indicators (like showing a background colour along with an underline) and there may be a common solution. One possibility is to have a 'then-draw' slot on each marker / indicator pointing to another marker / indicator to draw after drawing the first. The image linked from the mailing list shows an example of this in Inno Setup where a red circle is shown alongside the brighter red backgrounds.
Ok thanks. I will update it to just a SC_MARK_FOREGROUND then. Coloring the caret like it did doesn't really seem necessary, at least Visual Studio by default doesn't color the caret in cases when it uses the same forced fore+back color approach, like on lines with breakpoints.