[anjuta-extras] scintilla: Implement "opened" signal



commit be145d1b0862336338089754177b6f74383f92ad
Author: Johannes Schmid <jhs gnome org>
Date:   Sun Feb 12 13:48:01 2012 +0100

    scintilla: Implement "opened" signal
    
    This is need for find-in-files to know when a file was fully loaded.

 plugins/scintilla/text_editor.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/plugins/scintilla/text_editor.c b/plugins/scintilla/text_editor.c
index b6e0fa6..3422fe5 100644
--- a/plugins/scintilla/text_editor.c
+++ b/plugins/scintilla/text_editor.c
@@ -218,6 +218,15 @@ initialize_markers (TextEditor* te, GtkWidget *scintilla)
 	}
 }
 
+/* Hack to simulate async loading */
+static gboolean
+emit_opened (TextEditor* te)
+{
+	g_signal_emit_by_name (te, "opened");
+	return FALSE;
+}
+	
+
 #ifdef DEBUG
 static void
 on_scintila_already_destroyed (gpointer te, GObject *obj)
@@ -1782,7 +1791,10 @@ text_editor_load_file (TextEditor * te)
 		aneditor_command (te->editor_id, ANE_CLOSE_FOLDALL, 0, 0);
 	}
 	text_editor_set_line_number_width(te);
-	anjuta_status (te->status, _("File loaded successfully"), 5); 
+	anjuta_status (te->status, _("File loaded successfully"), 5);
+
+	g_idle_add ((GSourceFunc) emit_opened, te);
+	
 	return TRUE;
 }
 



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