SCI_SETMARGINLEFT and SC_MARK_BACKGROUND

34 views
Skip to first unread message

Sam Ransbotham

unread,
Feb 27, 2025, 3:42:21 PM2/27/25
to scintilla-interest
(Thanks for Scintilla -- great product.)

I'm trying to use SCI_SETMARGINLEFT and SC_MARK_BACKGROUND.  Using SC_MARK_BACKGROUND sets the background color of the line with the marker.  

But the blank margin set with SCI_SETMARGINLEFT seems to remain in the normal color, not the SC_MARK_BACKGROUND color.  What controls the color of the blank margin part?

(or am I doing something wrong elsewhere?)

Thanks,
Sam

Neil Hodgson

unread,
Mar 1, 2025, 4:39:33 AM3/1/25
to Scintilla mailing list
Sam Ransbotham:

> But the blank margin set with SCI_SETMARGINLEFT seems to remain in the normal color, not the SC_MARK_BACKGROUND color. What controls the color of the blank margin part?

The left and right margins are drawn in the background colour for STYLE_DEFAULT.

Neil

Sam Ransbotham

unread,
Mar 1, 2025, 2:03:16 PM3/1/25
to scintilla...@googlegroups.com
Thanks. Since there is only a single STYLE_DEFAULT, am I correct that this means the background color of the SCI_SETMARGINLEFT cannot change by line?

For example, this example sets the SCI_SETMARGINLEFT to 20 and uses a marker (SC_MARK_BACKGROUND) to change every other line to a yellow background. The SCI_SETMARGINLEFT background remains in the default background color (set by STYLE_DEFAULT) instead of using the SC_MARK_MARKBACKGROUND style. I expected that the background of the whole line would change (including the SCI_SETMARGINLEFT part).

PastedGraphic-1.png
Reply all
Reply to author
Forward
0 new messages