Revision: 4468 http://geany.svn.sourceforge.net/geany/?rev=4468&view=rev Author: ntrel Date: 2009-12-03 16:22:33 +0000 (Thu, 03 Dec 2009)
Log Message: ----------- Use lexer_filetype=C configuration file key instead of duplicate styleset functions for C++, C#, GLSL, Vala.
Modified Paths: -------------- trunk/ChangeLog trunk/data/filetypes.cpp trunk/data/filetypes.cs trunk/data/filetypes.glsl trunk/data/filetypes.vala trunk/src/highlighting.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-12-03 16:08:06 UTC (rev 4467) +++ trunk/ChangeLog 2009-12-03 16:22:33 UTC (rev 4468) @@ -6,6 +6,10 @@ * src/highlighting.c, data/filetypes.cpp, data/filetypes.cs, data/filetypes.c: Remove now unnecessary "styling_within_preprocessor" C style key. + * src/highlighting.c, data/filetypes.cpp, data/filetypes.vala, + data/filetypes.glsl, data/filetypes.cs: + Use lexer_filetype=C configuration file key instead of duplicate + styleset functions for C++, C#, GLSL, Vala.
2009-12-02 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/data/filetypes.cpp =================================================================== --- trunk/data/filetypes.cpp 2009-12-03 16:08:06 UTC (rev 4467) +++ trunk/data/filetypes.cpp 2009-12-03 16:22:33 UTC (rev 4468) @@ -39,6 +39,8 @@ preprocessor.end.$(file.patterns.cpp)=endif
[settings] +lexer_filetype=C + # default extension used when saving files #extension=cpp
Modified: trunk/data/filetypes.cs =================================================================== --- trunk/data/filetypes.cs 2009-12-03 16:08:06 UTC (rev 4467) +++ trunk/data/filetypes.cs 2009-12-03 16:22:33 UTC (rev 4468) @@ -39,6 +39,8 @@ preprocessor.end.$(file.patterns.cpp)=endif
[settings] +lexer_filetype=C + # default extension used when saving files #extension=cs
Modified: trunk/data/filetypes.glsl =================================================================== --- trunk/data/filetypes.glsl 2009-12-03 16:08:06 UTC (rev 4467) +++ trunk/data/filetypes.glsl 2009-12-03 16:22:33 UTC (rev 4468) @@ -42,6 +42,8 @@ preprocessor.end.$(file.patterns.cpp)=endif
[settings] +lexer_filetype=C + # default extension used when saving files #extension=glsl
Modified: trunk/data/filetypes.vala =================================================================== --- trunk/data/filetypes.vala 2009-12-03 16:08:06 UTC (rev 4467) +++ trunk/data/filetypes.vala 2009-12-03 16:22:33 UTC (rev 4468) @@ -39,6 +39,8 @@ preprocessor.end.$(file.patterns.cpp)=endif
[settings] +lexer_filetype=C + # default extension used when saving files #extension=vala
Modified: trunk/src/highlighting.c =================================================================== --- trunk/src/highlighting.c 2009-12-03 16:08:06 UTC (rev 4467) +++ trunk/src/highlighting.c 2009-12-03 16:22:33 UTC (rev 4468) @@ -947,106 +947,6 @@ }
-static void styleset_cpp_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) -{ - styleset_c_like_init(config, config_home, ft_id); - - style_sets[ft_id].keywords = g_new(gchar*, 4); - get_keyfile_keywords(config, config_home, "primary", ft_id, 0); - get_keyfile_keywords(config, config_home, "secondary", ft_id, 1); - get_keyfile_keywords(config, config_home, "docComment", ft_id, 2); - style_sets[ft_id].keywords[3] = NULL; -} - - -static void styleset_cpp(ScintillaObject *sci, gint ft_id) -{ - styleset_c_like(sci, ft_id); - - sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]); - /* for SCI_SETKEYWORDS = 1, see below*/ - sci_set_keywords(sci, 2, style_sets[ft_id].keywords[2]); - - /* assign global types, merge them with user defined keywords and set them */ - assign_global_and_user_keywords(sci, style_sets[ft_id].keywords[1], - filetypes[ft_id]->lang); -} - - -static void styleset_glsl_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) -{ - styleset_c_like_init(config, config_home, ft_id); - - style_sets[ft_id].keywords = g_new(gchar*, 4); - get_keyfile_keywords(config, config_home, "primary", ft_id, 0); - get_keyfile_keywords(config, config_home, "secondary", ft_id, 1); - get_keyfile_keywords(config, config_home, "docComment", ft_id, 2); - style_sets[ft_id].keywords[3] = NULL; -} - - -static void styleset_glsl(ScintillaObject *sci, gint ft_id) -{ - styleset_c_like(sci, ft_id); - - sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]); - /* for SCI_SETKEYWORDS = 1, see below*/ - sci_set_keywords(sci, 2, style_sets[ft_id].keywords[2]); - - /* assign global types, merge them with user defined keywords and set them */ - assign_global_and_user_keywords(sci, style_sets[ft_id].keywords[1], - filetypes[ft_id]->lang); -} - - -static void styleset_cs_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) -{ - styleset_c_like_init(config, config_home, ft_id); - - style_sets[ft_id].keywords = g_new(gchar*, 4); - get_keyfile_keywords(config, config_home, "primary", ft_id, 0); - get_keyfile_keywords(config, config_home, "secondary", ft_id, 1); - get_keyfile_keywords(config, config_home, "docComment", ft_id, 2); - style_sets[ft_id].keywords[3] = NULL; -} - - -static void styleset_cs(ScintillaObject *sci, gint ft_id) -{ - styleset_c_like(sci, ft_id); - - sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]); - sci_set_keywords(sci, 2, style_sets[ft_id].keywords[2]); - - /* assign global types, merge them with user defined keywords and set them */ - assign_global_and_user_keywords(sci, style_sets[ft_id].keywords[1], filetypes[ft_id]->lang); -} - - -static void styleset_vala_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) -{ - styleset_c_like_init(config, config_home, ft_id); - - style_sets[ft_id].keywords = g_new(gchar*, 4); - get_keyfile_keywords(config, config_home, "primary", ft_id, 0); - get_keyfile_keywords(config, config_home, "secondary", ft_id, 1); - get_keyfile_keywords(config, config_home, "docComment", ft_id, 2); - style_sets[ft_id].keywords[3] = NULL; -} - - -static void styleset_vala(ScintillaObject *sci, gint ft_id) -{ - styleset_c_like(sci, ft_id); - - sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]); - sci_set_keywords(sci, 2, style_sets[ft_id].keywords[2]); - - /* assign global types, merge them with user defined keywords and set them */ - assign_global_and_user_keywords(sci, style_sets[ft_id].keywords[1], filetypes[ft_id]->lang); -} - - static void styleset_pascal_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { new_styleset(ft_id, 15); @@ -3173,8 +3073,6 @@ init_styleset_case(GEANY_FILETYPES_CAML, styleset_caml_init); init_styleset_case(GEANY_FILETYPES_CMAKE, styleset_cmake_init); init_styleset_case(GEANY_FILETYPES_CONF, styleset_conf_init); - init_styleset_case(GEANY_FILETYPES_CPP, styleset_cpp_init); - init_styleset_case(GEANY_FILETYPES_CS, styleset_cs_init); init_styleset_case(GEANY_FILETYPES_CSS, styleset_css_init); init_styleset_case(GEANY_FILETYPES_D, styleset_d_init); init_styleset_case(GEANY_FILETYPES_DIFF, styleset_diff_init); @@ -3182,7 +3080,6 @@ init_styleset_case(GEANY_FILETYPES_FERITE, styleset_ferite_init); init_styleset_case(GEANY_FILETYPES_F77, styleset_f77_init); init_styleset_case(GEANY_FILETYPES_FORTRAN, styleset_fortran_init); - init_styleset_case(GEANY_FILETYPES_GLSL, styleset_glsl_init); init_styleset_case(GEANY_FILETYPES_HASKELL, styleset_haskell_init); init_styleset_case(GEANY_FILETYPES_HAXE, styleset_haxe_init); init_styleset_case(GEANY_FILETYPES_AS, styleset_actionscript_init); @@ -3205,7 +3102,6 @@ init_styleset_case(GEANY_FILETYPES_SH, styleset_sh_init); init_styleset_case(GEANY_FILETYPES_SQL, styleset_sql_init); init_styleset_case(GEANY_FILETYPES_TCL, styleset_tcl_init); - init_styleset_case(GEANY_FILETYPES_VALA, styleset_vala_init); init_styleset_case(GEANY_FILETYPES_VHDL, styleset_vhdl_init); init_styleset_case(GEANY_FILETYPES_XML, styleset_markup_init); init_styleset_case(GEANY_FILETYPES_YAML, styleset_yaml_init); @@ -3242,8 +3138,6 @@ styleset_case(GEANY_FILETYPES_CAML, styleset_caml); styleset_case(GEANY_FILETYPES_CMAKE, styleset_cmake); styleset_case(GEANY_FILETYPES_CONF, styleset_conf); - styleset_case(GEANY_FILETYPES_CPP, styleset_cpp); - styleset_case(GEANY_FILETYPES_CS, styleset_cs); styleset_case(GEANY_FILETYPES_CSS, styleset_css); styleset_case(GEANY_FILETYPES_D, styleset_d); styleset_case(GEANY_FILETYPES_DIFF, styleset_diff); @@ -3251,7 +3145,6 @@ styleset_case(GEANY_FILETYPES_FERITE, styleset_ferite); styleset_case(GEANY_FILETYPES_F77, styleset_f77); styleset_case(GEANY_FILETYPES_FORTRAN, styleset_fortran); - styleset_case(GEANY_FILETYPES_GLSL, styleset_glsl); styleset_case(GEANY_FILETYPES_HASKELL, styleset_haskell); styleset_case(GEANY_FILETYPES_HAXE, styleset_haxe); styleset_case(GEANY_FILETYPES_AS, styleset_actionscript); @@ -3274,7 +3167,6 @@ styleset_case(GEANY_FILETYPES_SH, styleset_sh); styleset_case(GEANY_FILETYPES_SQL, styleset_sql); styleset_case(GEANY_FILETYPES_TCL, styleset_tcl); - styleset_case(GEANY_FILETYPES_VALA, styleset_vala); styleset_case(GEANY_FILETYPES_VHDL, styleset_vhdl); styleset_case(GEANY_FILETYPES_XML, styleset_xml); styleset_case(GEANY_FILETYPES_YAML, styleset_yaml);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.