[Geany-devel] Selection and colour schemes

Nick Treleaven nick.treleaven at xxxxx
Sun Jun 3 16:49:35 UTC 2012


On 02/06/2012 07:27, Lex Trotman wrote:
> Hi All,
>
> I just pushed a "fix" for switching colour schemes from say dark to
> default leaving selection unchanged.
>
> But in reality the code at highlighting.c doesn't actually do what it
> advertises, the comment says "to override default" which matches the
> documentation, but in fact what the code does is "to change from what
> is currently set".  Of course if you are changing from default to
> another colour scheme thats ok, but if you are changing from a colour
> scheme that has changed this setting then what is set won't be
> default.
>
> I think the code should be:
> if (common_style_set.styling[GCS_SELECTION].bold)
>      SSM(sci, SCI_SETSELFORE, etc...
> else
>      SSM(sci, SCI_SETSELFORE, whatever the default is)
>
> but I can't find where to get the real default value and have run out of time.

I've committed a fix, and also restored using the default foreground 
color for selections, so the style information can still be seen. You're 
right to enable the default background color, as otherwise with no 
overrides users can't see any selection.

The default is explained here:
http://www.scintilla.org/ScintillaDoc.html#SCI_SETSELFORE

SCI_SETSELFORE(bool useSelectionForeColour, int colour)
SCI_SETSELBACK(bool useSelectionBackColour, int colour)
You can choose to override the default selection colouring with these 
two messages. The colour you provide is used if you set 
useSelection*Colour to true. If it is set to false, the default styled 
colouring is used and the colour argument has no effect.



More information about the Devel mailing list