diff --git a/ChangeLog b/ChangeLog
index 5c22dbf8..51cf0608 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,9 @@
Set default highlighting style for filetype None to get it also
inverted if invert_all is set.
Reset all previously defined styles when switching filetype to None.
+ * data/filetypes.common, doc/geany.docbook, src/highlighting.c:
+ Added style "default" to filetypes.common to be able to change the
+ default style for files without a filetype set.
diff --git a/data/filetypes.common b/data/filetypes.common
index 86cd93ea..696fcda3 100644
--- a/data/filetypes.common
+++ b/data/filetypes.common
@@ -1,5 +1,8 @@
# For complete documentation of this file, please see Geany's main documentation
[styling]
+# foreground;background;bold;italic - used for filetype All/None
+default=0x000000;0xffffff;false;false
+
# 3rd selection argument is true to override default foreground
# 4th selection argument is true to override default background
selection=0xc0c0c0;0x7f0000;false;false
diff --git a/doc/geany.docbook b/doc/geany.docbook
index ea115ba3..4183c1db 100644
--- a/doc/geany.docbook
+++ b/doc/geany.docbook
@@ -1719,6 +1719,13 @@
+
+ default
+ This is the default style. It is used for styling files
+ without a filetype set.
+
+ default=0x000000;0xffffff;false;false
+
selection
diff --git a/src/highlighting.c b/src/highlighting.c
index b63ebe10..7288df23 100644
--- a/src/highlighting.c
+++ b/src/highlighting.c
@@ -60,6 +60,7 @@ static StyleSet style_sets[GEANY_MAX_FILE_TYPES - 1];
enum // Geany common styling
{
+ GCS_DEFAULT,
GCS_SELECTION,
GCS_BRACE_GOOD,
GCS_BRACE_BAD,
@@ -376,6 +377,8 @@ static void styleset_common_init(void)
load_keyfiles(config, config_home, GEANY_FILETYPES_ALL);
+ get_keyfile_hex(config, config_home, "styling", "default",
+ "0x000000", "0xffffff", "false", &common_style_set.styling[GCS_DEFAULT]);
get_keyfile_hex(config, config_home, "styling", "selection",
"0xc0c0c0", "0x7f0000", "false", &common_style_set.styling[GCS_SELECTION]);
get_keyfile_hex(config, config_home, "styling", "brace_good",
@@ -1973,12 +1976,12 @@ void styleset_docbook(ScintillaObject *sci)
void styleset_none(ScintillaObject *sci)
{
styleset_common(sci, 5);
+
SSM (sci, SCI_SETLEXER, SCLEX_NULL, 0);
SSM(sci, SCI_SETWORDCHARS, 0, (sptr_t) common_style_set.wordchars);
- SSM(sci, SCI_STYLESETFORE, STYLE_DEFAULT, invert(0x000000));
- SSM(sci, SCI_STYLESETBACK, STYLE_DEFAULT, invert(0xffffff));
+ set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_ALL, GCS_DEFAULT);
SSM(sci, SCI_STYLECLEARALL, 0, 0);
}