SF.net SVN: geany:[4447] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Tue Nov 24 16:47:36 UTC 2009


Revision: 4447
          http://geany.svn.sourceforge.net/geany/?rev=4447&view=rev
Author:   ntrel
Date:     2009-11-24 16:47:35 +0000 (Tue, 24 Nov 2009)

Log Message:
-----------
Fix lexer settings for custom filetypes.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/highlighting.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-11-24 16:27:37 UTC (rev 4446)
+++ trunk/ChangeLog	2009-11-24 16:47:35 UTC (rev 4447)
@@ -8,6 +8,8 @@
    have properties set.
  * src/symbols.c, tagmanager/vhdl.c:
    Parse VHDL signals.
+ * src/highlighting.c:
+   Fix lexer settings for custom filetypes.
 
 
 2009-11-23  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>

Modified: trunk/src/highlighting.c
===================================================================
--- trunk/src/highlighting.c	2009-11-24 16:27:37 UTC (rev 4446)
+++ trunk/src/highlighting.c	2009-11-24 16:47:35 UTC (rev 4447)
@@ -3164,6 +3164,7 @@
 void highlighting_init_styles(gint filetype_idx, GKeyFile *config, GKeyFile *configh)
 {
 	GeanyFiletype *ft = filetypes[filetype_idx];
+	gint lexer_id = ft->lexer_filetype ? ft->lexer_filetype->id : ft->id;
 
 	if (!style_sets)
 		style_sets = g_new0(StyleSet, filetypes_array->len);
@@ -3175,7 +3176,7 @@
 	if (filetype_idx != GEANY_FILETYPES_NONE)
 		filetypes_load_config(GEANY_FILETYPES_NONE, FALSE);
 
-	switch (filetype_idx)
+	switch (lexer_id)
 	{
 		init_styleset_case(GEANY_FILETYPES_NONE,	styleset_common_init);
 		init_styleset_case(GEANY_FILETYPES_ADA,		styleset_ada_init);
@@ -3233,7 +3234,7 @@
 /* lang_name is the name used for the styleset_foo function, e.g. foo. */
 #define styleset_case(ft_id, styleset_func) \
 	case (ft_id): \
-		styleset_func(sci, ft_id); \
+		styleset_func(sci, ft->id); \
 		break
 
 /** Setup highlighting and other visual settings.


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list