@techee requested changes on this pull request.
Looks good and works well, again just some minor comments.
I also noticed that I get
(geany:47456): Geany-CRITICAL **: 22:18:37.629: document_open_file_full: assertion 'filename' failed
when starting Geany with geany some_nonexistent_file.txt
. The corresponding backtrace when using --g-fatal-warnings
is
#5 0x0000fffff7c27dc0 in document_open_file_full
(doc=doc@entry=0x0, filename=<optimized out>, pos=pos@entry=0, readonly=readonly@entry=0, ft=ft@entry=0x0, forced_enc=forced_enc@entry=0x0)
at document.c:1313
#6 0x0000fffff7c28140 in document_open_file
(locale_filename=<optimized out>, readonly=readonly@entry=0, ft=ft@entry=0x0, forced_enc=forced_enc@entry=0x0) at document.c:908
#7 0x0000ffffeccd53fc in load_all_temp_files_idle (data=<optimized out>)
at saveactions.c:624
> @@ -109,6 +109,12 @@ static gchar *config_file; static gboolean session_is_changing = FALSE; +int count_opened_notebook_tabs()
Make static
and int
-> gint
.
> + show_unsaved_dialog_for_persistent_temp_files_tab_closing( + doc, + short_filename + ); + } + else + { + g_remove(doc->real_path); + + ui_set_statusbar(TRUE, _("Empty temp file %s was deleted"), short_filename); + } + + g_free(short_filename); + + } + else if (geany_is_closing_all_documents() && count_opened_notebook_tabs() == 1)
I wasn't sure if this would work but I just checked Geany code and documents are closed one by one so the check here should be OK.
> + { + /* remove temp file if it was saved as some other file */ + gchar *locale_old_file_path = utils_get_locale_from_utf8(old_file_path_utf8); + g_remove(locale_old_file_path); + + g_free(locale_old_file_path); + + ui_set_statusbar(TRUE, _("Temp file %s was deleted"), old_file_path_utf8); + } + + plugin_set_document_data(geany_plugin, doc, "file-name-before-save-as", NULL); /* clear value */ + } +} + + +static void load_all_temp_files_into_editor()
Also void
here.
> @@ -109,6 +109,12 @@ static gchar *config_file; static gboolean session_is_changing = FALSE; +int count_opened_notebook_tabs()
Plus void
: count_opened_notebook_tabs(void)
- this is not C++ as @b4n would say every time I forgot to add it :-).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.