SF.net SVN: geany:[2937] branches/split-window-plugin
ntrel at users.sourceforge.net
ntrel at xxxxx
Thu Sep 11 15:06:14 UTC 2008
Revision: 2937
http://geany.svn.sourceforge.net/geany/?rev=2937&view=rev
Author: ntrel
Date: 2008-09-11 15:06:14 +0000 (Thu, 11 Sep 2008)
Log Message:
-----------
Unsplit when the source document is closed.
Modified Paths:
--------------
branches/split-window-plugin/ChangeLog
branches/split-window-plugin/plugins/splitwindow.c
Modified: branches/split-window-plugin/ChangeLog
===================================================================
--- branches/split-window-plugin/ChangeLog 2008-09-11 15:03:58 UTC (rev 2936)
+++ branches/split-window-plugin/ChangeLog 2008-09-11 15:06:14 UTC (rev 2937)
@@ -4,6 +4,8 @@
doc/plugins.dox:
Add plugin signal "document-close", sent just before a document is
closed.
+ * plugins/splitwindow.c:
+ Unsplit when the source document is closed.
2008-09-10 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: branches/split-window-plugin/plugins/splitwindow.c
===================================================================
--- branches/split-window-plugin/plugins/splitwindow.c 2008-09-11 15:03:58 UTC (rev 2936)
+++ branches/split-window-plugin/plugins/splitwindow.c 2008-09-11 15:06:14 UTC (rev 2937)
@@ -254,6 +254,20 @@
}
+static void on_document_close(GObject *obj, GeanyDocument *doc, gpointer user_data)
+{
+ /* remove the split window because the document won't exist anymore */
+ if (our_editor && doc == our_editor->document)
+ on_unsplit(NULL, NULL);
+}
+
+PluginCallback plugin_callbacks[] =
+{
+ { "document-close", (GCallback) &on_document_close, FALSE, NULL },
+ { NULL, NULL, FALSE, NULL }
+};
+
+
void plugin_cleanup()
{
if (plugin_state != STATE_UNSPLIT)
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