anjuta r3473 - in trunk: . plugins/editor plugins/symbol-browser



Author: naba
Date: Tue Jan 15 21:50:50 2008
New Revision: 3473
URL: http://svn.gnome.org/viewvc/anjuta?rev=3473&view=rev

Log:
	* plugins/editor/text_editor.c: (isavable_save_as): Correctly highlight
	newfile saved. Fixes bug #502322 - Highlight doesn\'t work on new
	file saved

	* plugins/symbol-browser/an_symbol_view.c:
	(anjuta_symbol_view_workspace_update_file): Refresh the symbols for
	new file saved.


Modified:
   trunk/ChangeLog
   trunk/plugins/editor/text_editor.c
   trunk/plugins/symbol-browser/an_symbol_view.c

Modified: trunk/plugins/editor/text_editor.c
==============================================================================
--- trunk/plugins/editor/text_editor.c	(original)
+++ trunk/plugins/editor/text_editor.c	Tue Jan 15 21:50:50 2008
@@ -2725,11 +2725,30 @@
 static void
 isavable_save_as (IAnjutaFileSavable* editor, const gchar* filename, GError** e)
 {
+	const gchar *past_language;
+	const gchar *curr_language;
 	TextEditor *text_editor = TEXT_EDITOR(editor);
-	text_editor->uri = g_strdup(filename);
+	
+	past_language =
+		ianjuta_editor_language_get_language (IANJUTA_EDITOR_LANGUAGE (text_editor),
+											  NULL);
+	
+	text_editor->uri = g_strdup (filename);
 	/* Remove path */
-	text_editor->filename = g_strdup(strrchr(filename, '/') + 1);
-	text_editor_save_file(text_editor, FALSE);
+	text_editor->filename = g_path_get_basename (filename);
+	text_editor_save_file (text_editor, FALSE);
+	text_editor_set_hilite_type (text_editor, NULL);
+	text_editor_hilite (text_editor, FALSE);
+	
+	/* We have to take care of 'language-change' signal ourself because
+	 * text_editor_set_hilite_type() only emits it for forced hilite type
+	 */
+	curr_language =
+		ianjuta_editor_language_get_language (IANJUTA_EDITOR_LANGUAGE (text_editor),
+											  NULL);
+	if (past_language != curr_language)
+		g_signal_emit_by_name (text_editor, "language-changed", curr_language);
+	
 }
 
 static gboolean

Modified: trunk/plugins/symbol-browser/an_symbol_view.c
==============================================================================
--- trunk/plugins/symbol-browser/an_symbol_view.c	(original)
+++ trunk/plugins/symbol-browser/an_symbol_view.c	Tue Jan 15 21:50:50 2008
@@ -1319,7 +1319,7 @@
 	g_return_if_fail (new_file_uri != NULL);
 	if (old_file_uri)
 		anjuta_symbol_view_workspace_remove_file (sv, old_file_uri);
-	anjuta_symbol_view_workspace_add_file (sv, old_file_uri);
+	anjuta_symbol_view_workspace_add_file (sv, new_file_uri);
 #if 0
 	const gchar *uri;
 	TMWorkObject *tm_file;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]