Unsplit when the source document is closed.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/split-window-plugin@2937 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2008-09-11 15:06:14 +00:00
parent a0fc129a49
commit 0bf9414532
2 changed files with 16 additions and 0 deletions

View File

@ -4,6 +4,8 @@
doc/plugins.dox: doc/plugins.dox:
Add plugin signal "document-close", sent just before a document is Add plugin signal "document-close", sent just before a document is
closed. closed.
* plugins/splitwindow.c:
Unsplit when the source document is closed.
2008-09-10 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> 2008-09-10 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>

View File

@ -254,6 +254,20 @@ void plugin_init(GeanyData *data)
} }
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() void plugin_cleanup()
{ {
if (plugin_state != STATE_UNSPLIT) if (plugin_state != STATE_UNSPLIT)