diff --git a/src/document.c b/src/document.c index d5d37b9b4b..e1baf3f5f4 100644 --- a/src/document.c +++ b/src/document.c @@ -784,8 +784,15 @@ gboolean document_remove_page(guint page_num) { gboolean done = remove_page(page_num); - if (done && ui_prefs.new_document_after_close) - document_new_file_if_non_open(); + if (done) + { + if (ui_prefs.new_document_after_close) + document_new_file_if_non_open(); + + if (! main_status.closing_all) + if (app->project != NULL) + project_write_config(); + } return done; } @@ -1425,7 +1432,6 @@ GeanyDocument *document_open_file_full(GeanyDocument *doc, const gchar *filename if (! reload) { - /* "the" SCI signal (connect after initial setup(i.e. adding text)) */ g_signal_connect(doc->editor->sci, "sci-notify", G_CALLBACK(editor_sci_notify_cb), doc->editor); @@ -1481,6 +1487,11 @@ GeanyDocument *document_open_file_full(GeanyDocument *doc, const gchar *filename if (! main_status.opening_session_files) ui_add_recent_document(doc); + /* save the project if one is open */ + if (! main_status.opening_session_files && ! reload) + if (app->project != NULL) + project_write_config(); + if (reload) { g_signal_emit_by_name(geany_object, "document-reload", doc);