SF.net SVN: geany: [856] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Sat Sep 30 16:15:50 UTC 2006


Revision: 856
          http://svn.sourceforge.net/geany/?rev=856&view=rev
Author:   ntrel
Date:     2006-09-30 09:15:45 -0700 (Sat, 30 Sep 2006)

Log Message:
-----------
Clear the symbol list when opening a file with no tags.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/document.c
    trunk/src/ui_utils.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-09-30 14:49:35 UTC (rev 855)
+++ trunk/ChangeLog	2006-09-30 16:15:45 UTC (rev 856)
@@ -5,6 +5,8 @@
    memory. Added separate struct for the common style set. Also
    use a struct for tracking the loaded global tags files. Renamed
    some static functions.
+ * src/document.c, src/ui_utils.c:
+   Clear the symbol list when opening a file with no tags.
 
 
 2006-09-29  Enrico Tröger  <enrico.troeger at uvena.de>

Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c	2006-09-30 14:49:35 UTC (rev 855)
+++ trunk/src/document.c	2006-09-30 16:15:45 UTC (rev 856)
@@ -386,11 +386,10 @@
 
 		doc_list[idx].encoding = g_strdup(encodings[app->pref_editor_default_encoding].charset);
 		//document_set_filetype(idx, (ft == NULL) ? filetypes[GEANY_FILETYPES_ALL] : ft);
-		document_set_filetype(idx, ft);
+		document_set_filetype(idx, ft);	// also clears taglist
 		if (ft == NULL) filetypes[GEANY_FILETYPES_ALL]->style_func_ptr(doc_list[idx].sci);
 		ui_set_window_title(idx);
 		ui_build_show_hide(idx);
-		ui_update_tag_list(idx, FALSE);
 		doc_list[idx].mtime = time(NULL);
 		doc_list[idx].changed = FALSE;
 		document_set_text_changed(idx);
@@ -660,11 +659,11 @@
 		doc_list[idx].readonly = readonly;
 		sci_set_readonly(doc_list[idx].sci, readonly);
 
-		document_set_filetype(idx, use_ft);
+		document_set_filetype(idx, use_ft);	// also sets taglist
 		ui_build_show_hide(idx);
 	}
 	else
-	{
+	{	// reloading
 		document_update_tag_list(idx, TRUE);
 	}
 
@@ -1107,9 +1106,14 @@
 
 void document_update_tag_list(gint idx, gboolean update)
 {
-	// if the filetype doesn't has a tag parser or it is a new file, leave
+	// if the filetype doesn't have a tag parser or it is a new file
 	if (idx == -1 || doc_list[idx].file_type == NULL ||
-		! doc_list[idx].file_type->has_tags || ! doc_list[idx].file_name) return;
+		! doc_list[idx].file_type->has_tags || ! doc_list[idx].file_name)
+	{
+		// set the default (empty) tag list
+		ui_update_tag_list(idx, FALSE);
+		return;
+	}
 
 	if (doc_list[idx].tm_file == NULL)
 	{

Modified: trunk/src/ui_utils.c
===================================================================
--- trunk/src/ui_utils.c	2006-09-30 14:49:35 UTC (rev 855)
+++ trunk/src/ui_utils.c	2006-09-30 16:15:45 UTC (rev 856)
@@ -180,6 +180,7 @@
 }
 
 
+// update = rescan the tags for document[idx].filename
 void ui_update_tag_list(gint idx, gboolean update)
 {
 	GList *tmp;


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