Revision: 1253 http://svn.sourceforge.net/geany/?rev=1253&view=rev Author: ntrel Date: 2007-02-07 04:28:09 -0800 (Wed, 07 Feb 2007)
Log Message: ----------- Fix missing global tags for C files when a C++ source file was loaded first.
Modified Paths: -------------- branches/geany-0.10.1/NEWS branches/geany-0.10.1/src/symbols.c
Modified: branches/geany-0.10.1/NEWS =================================================================== --- branches/geany-0.10.1/NEWS 2007-02-06 17:39:19 UTC (rev 1252) +++ branches/geany-0.10.1/NEWS 2007-02-07 12:28:09 UTC (rev 1253) @@ -3,6 +3,8 @@ Bugs fixed: * Wrong tab foreground colour for unmodified documents. * Fixed crashes when closing dialogs by clicking X on some systems. + * Fix missing global tags for C files when a C++ source file was + loaded first.
Geany 0.10 (December 21, 2006)
Modified: branches/geany-0.10.1/src/symbols.c =================================================================== --- branches/geany-0.10.1/src/symbols.c 2007-02-06 17:39:19 UTC (rev 1252) +++ branches/geany-0.10.1/src/symbols.c 2007-02-07 12:28:09 UTC (rev 1253) @@ -37,6 +37,15 @@ tm_tag_struct_t | tm_tag_typedef_t | tm_tag_union_t;
+static gchar **html_entities = NULL; + + +typedef struct +{ + gboolean tags_loaded; + const gchar *tag_file; +} TagFileInfo; + enum // Geany tag files { GTF_C, @@ -47,14 +56,6 @@ GTF_MAX };
-static gchar **html_entities = NULL; - -typedef struct -{ - gboolean tags_loaded; - const gchar *tag_file; -} TagFileInfo; - static TagFileInfo tag_file_info[GTF_MAX] = { {FALSE, "global.tags"}, @@ -72,7 +73,7 @@ void symbols_global_tags_loaded(gint file_type_idx) { TagFileInfo *tfi; - gint gtf, lt; + gint tag_type;
if (app->ignore_global_tags) return;
@@ -81,27 +82,32 @@ case GEANY_FILETYPES_HTML: html_tags_loaded(); return; - case GEANY_FILETYPES_C: gtf = GTF_C; break; - case GEANY_FILETYPES_CPP: gtf = GTF_C; break; - case GEANY_FILETYPES_PASCAL:gtf = GTF_PASCAL; break; - case GEANY_FILETYPES_PHP: gtf = GTF_PHP; break; - case GEANY_FILETYPES_LATEX: gtf = GTF_LATEX; break; + case GEANY_FILETYPES_CPP: + symbols_global_tags_loaded(GEANY_FILETYPES_C); // load C global tags + return; // no C++ tagfile yet + case GEANY_FILETYPES_C: tag_type = GTF_C; break; + case GEANY_FILETYPES_PASCAL:tag_type = GTF_PASCAL; break; + case GEANY_FILETYPES_PHP: tag_type = GTF_PHP; break; + case GEANY_FILETYPES_LATEX: tag_type = GTF_LATEX; break; default: return; } - lt = filetypes[file_type_idx]->lang; - tfi = &tag_file_info[gtf]; + tfi = &tag_file_info[tag_type];
if (! tfi->tags_loaded) { - gchar *file = g_strconcat(app->datadir, G_DIR_SEPARATOR_S, tfi->tag_file, NULL); - tm_workspace_load_global_tags(file, lt); + gchar *fname = g_strconcat(app->datadir, G_DIR_SEPARATOR_S, tfi->tag_file, NULL); + gint tm_lang; + + tm_lang = filetypes[file_type_idx]->lang; + tm_workspace_load_global_tags(fname, tm_lang); tfi->tags_loaded = TRUE; - g_free(file); + g_free(fname); } }
+// HTML tagfile is just a list of entities for autocompletion (e.g. '&') static void html_tags_loaded() { TagFileInfo *tfi; @@ -112,6 +118,7 @@ if (! tfi->tags_loaded) { gchar *file = g_strconcat(app->datadir, G_DIR_SEPARATOR_S, tfi->tag_file, NULL); + html_entities = utils_read_file_in_array(file); tfi->tags_loaded = TRUE; g_free(file);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.