SF.net SVN: geany:[3693] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Tue Apr 7 15:28:03 UTC 2009


Revision: 3693
          http://geany.svn.sourceforge.net/geany/?rev=3693&view=rev
Author:   ntrel
Date:     2009-04-07 15:28:03 +0000 (Tue, 07 Apr 2009)

Log Message:
-----------
Add Configuration Files item for snippets.conf.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/editor.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-04-06 22:36:32 UTC (rev 3692)
+++ trunk/ChangeLog	2009-04-07 15:28:03 UTC (rev 3693)
@@ -1,3 +1,9 @@
+2009-04-07  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/editor.c:
+   Add Configuration Files item for snippets.conf.
+
+
 2009-04-06  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
 
  * src/interface.c, src/printing.c, geany.glade:

Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c	2009-04-06 22:36:32 UTC (rev 3692)
+++ trunk/src/editor.c	2009-04-07 15:28:03 UTC (rev 3693)
@@ -4355,6 +4355,20 @@
 }
 
 
+static void on_document_save(GObject *obj, GeanyDocument *doc)
+{
+	g_return_if_fail(NZV(doc->real_path));
+
+	if (utils_str_equal(doc->real_path,
+		utils_build_path(app->configdir, "snippets.conf", NULL)))
+	{
+		/* reload snippets */
+		editor_snippets_free();
+		editor_snippets_init();
+	}
+}
+
+
 void editor_init(void)
 {
 	static GeanyIndentPrefs indent_prefs;
@@ -4366,6 +4380,10 @@
 	/* use g_signal_connect_after() to allow plugins connecting to the signal before the default
 	 * handler (on_editor_notify) is called */
 	g_signal_connect_after(geany_object, "editor-notify", G_CALLBACK(on_editor_notify), NULL);
+
+	ui_add_config_file_menu_item(utils_build_path(app->configdir, "snippets.conf", NULL),
+		NULL, NULL);
+	g_signal_connect(geany_object, "document-save", G_CALLBACK(on_document_save), NULL);
 }
 
 


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