Revision: 1538 http://svn.sourceforge.net/geany/?rev=1538&view=rev Author: ntrel Date: 2007-05-16 05:26:53 -0700 (Wed, 16 May 2007)
Log Message: ----------- Fix bug when loading custom filetypes.common styles.
Modified Paths: -------------- trunk/ChangeLog trunk/src/highlighting.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-05-15 16:04:37 UTC (rev 1537) +++ trunk/ChangeLog 2007-05-16 12:26:53 UTC (rev 1538) @@ -1,3 +1,9 @@ +2007-05-16 Nick Treleaven nick.treleaven@btinternet.com + + * src/highlighting.c: + Fix bug when loading custom filetypes.common styles. + + 2007-05-15 Nick Treleaven nick.treleaven@btinternet.com
* src/highlighting.c, data/filetypes.common:
Modified: trunk/src/highlighting.c =================================================================== --- trunk/src/highlighting.c 2007-05-15 16:04:37 UTC (rev 1537) +++ trunk/src/highlighting.c 2007-05-16 12:26:53 UTC (rev 1538) @@ -355,12 +355,19 @@ }
-/* This should only be called from styleset_common(). */ static void styleset_common_init(void) { - GKeyFile *config = g_key_file_new(); - GKeyFile *config_home = g_key_file_new(); + GKeyFile *config; + GKeyFile *config_home; + static gboolean common_style_set_valid = FALSE;
+ if (common_style_set_valid) + return; + common_style_set_valid = TRUE; // ensure filetypes.common is only loaded once + + config = g_key_file_new(); + config_home = g_key_file_new(); + load_keyfiles(config, config_home, GEANY_FILETYPES_ALL);
get_keyfile_hex(config, config_home, "styling", "default", @@ -411,14 +418,8 @@
static void styleset_common(ScintillaObject *sci, gint style_bits, filetype_id ft_id) { - static gboolean common_style_set_valid = FALSE; + styleset_common_init();
- if (! common_style_set_valid) - { - styleset_common_init(); - common_style_set_valid = TRUE; - } - // load global tags file for autocompletion, calltips, etc. if (ft_id < GEANY_FILETYPES_ALL) symbols_global_tags_loaded(ft_id); @@ -1982,10 +1983,13 @@
SSM(sci, SCI_SETLEXER, SCLEX_NULL, 0);
- styleset_common(sci, 5, ft_id); + if (style_sets[GEANY_FILETYPES_ALL].styling == NULL) + styleset_common_init();
set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_ALL, GCS_DEFAULT);
+ styleset_common(sci, 5, ft_id); + SSM(sci, SCI_SETWORDCHARS, 0, (sptr_t) common_style_set.wordchars); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.