From bee3806d47aed09f495bb74dbd6b48032a70f166 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sun, 21 Aug 2016 14:20:21 +0200 Subject: [PATCH] Allow to configure the error indicator color Related to #1116. --- data/filedefs/filetypes.common | 3 +++ doc/geany.txt | 7 +++++++ src/highlighting.c | 5 ++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/data/filedefs/filetypes.common b/data/filedefs/filetypes.common index 1b163c9c..f0992e32 100644 --- a/data/filedefs/filetypes.common +++ b/data/filedefs/filetypes.common @@ -93,6 +93,9 @@ line_height=0;0; # 4th argument is true to override default background of calltips calltips=call_tips +# error indicator color +indicator_error=0xff0000 + [settings] # which characters should be skipped when moving (or included when deleting) to word boundaries # should always include space and tab (\s\t) diff --git a/doc/geany.txt b/doc/geany.txt index 27c67a2e..65e38f59 100644 --- a/doc/geany.txt +++ b/doc/geany.txt @@ -4593,6 +4593,13 @@ calltips *Example:* ``calltips=0xc0c0c0;0xffffff;false;false`` +indicator_error + The color of the error indicator. + + Only the first argument (foreground color) is used. + + *Example:* ``indicator_error=0xff0000`` + [settings] section `````````````````` diff --git a/src/highlighting.c b/src/highlighting.c index 0a700b62..5dd0e0f4 100644 --- a/src/highlighting.c +++ b/src/highlighting.c @@ -97,6 +97,7 @@ enum /* Geany common styling */ GCS_MARKER_TRANSLUCENCY, GCS_LINE_HEIGHT, GCS_CALLTIPS, + GCS_INDICATOR_ERROR, GCS_MAX }; @@ -560,6 +561,7 @@ static void styleset_common_init(GKeyFile *config, GKeyFile *config_home) get_keyfile_style(config, config_home, "marker_search", &common_style_set.styling[GCS_MARKER_SEARCH]); get_keyfile_style(config, config_home, "marker_mark", &common_style_set.styling[GCS_MARKER_MARK]); get_keyfile_style(config, config_home, "calltips", &common_style_set.styling[GCS_CALLTIPS]); + get_keyfile_style(config, config_home, "indicator_error", &common_style_set.styling[GCS_INDICATOR_ERROR]); get_keyfile_ints(config, config_home, "styling", "folding_style", 1, 1, &common_style_set.fold_marker, &common_style_set.fold_lines); @@ -649,7 +651,8 @@ static void styleset_common(ScintillaObject *sci, guint ft_id) /* Error indicator */ SSM(sci, SCI_INDICSETSTYLE, GEANY_INDICATOR_ERROR, INDIC_SQUIGGLEPIXMAP); - SSM(sci, SCI_INDICSETFORE, GEANY_INDICATOR_ERROR, invert(0x0000FF /* red, in BGR */)); + SSM(sci, SCI_INDICSETFORE, GEANY_INDICATOR_ERROR, + invert(common_style_set.styling[GCS_INDICATOR_ERROR].foreground)); /* Search indicator, used for 'Mark' matches */ SSM(sci, SCI_INDICSETSTYLE, GEANY_INDICATOR_SEARCH, INDIC_ROUNDBOX);