From 0b84fced12f3e6dd3fd0da760919db026301e92d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Fri, 9 Mar 2007 18:14:34 +0000 Subject: [PATCH] Added style "default" to filetypes.common to be able to change the default style for files without a filetype set. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1380 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 3 +++ data/filetypes.common | 3 +++ doc/geany.docbook | 7 +++++++ src/highlighting.c | 7 +++++-- 4 files changed, 18 insertions(+), 2 deletions(-) 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); }