[Github-comments] [geany/geany] Add reload all keybinding (#2859)

elextr notifications at xxxxx
Mon Aug 9 10:41:55 UTC 2021


@elextr commented on this pull request.



> @@ -335,6 +335,21 @@ void on_toolbutton_reload_clicked(GtkAction *action, gpointer user_data)
 	document_reload_prompt(doc, NULL);
 }
 
+/* reload all files */
+void on_toolbutton_reload_all_clicked(GtkAction *action, gpointer user_data)
+{
+	guint i;
+	gint cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.notebook));
+	
+	foreach_document(i)
+	{
+		if (! (documents[i]->file_name == NULL))

> Pretty sure automatic detection doesn't do it as you switch to the tab

Hmmm, on checking it seems as if it is only done if you switch tabs by the tab right menu, not if you click the tab, I wonder why?  I had the impression it was done each time a tab switch happened to ensure the infobar came up.  Seems more like omission than intention.  Will raise an issue.

> file_prefs.reload_clean_doc_on_file_change is on ... it sounds like a world of accidental data loss

Correct, which is why its off by default and its hidden in the various prefs.  But some people use Geany to watch logs and other things that regularly update, and they insist they need it.  So its available as caveat emptor.

> keep_edit_history_on_reload to conditionally quietly reload files with an edit history

The prompt should only appear if `files.keep_edit_history_on_reload` is off, if its on then data loss is avoided because the reload is undo-able.  So automatic reload can happen irrespective of the buffer state.  That seems to be what https://github.com/geany/geany/blob/90c6096ed6ea167f9100ce8f74229a3f47acc29a/src/document.c#L1651 does, but please let us know if it seems not to work.

The various tab seems to have become a catch all for settings because making changes to the glade file for the other preferences tabs was too hard when it was necessary to use a Glade version that was GTK 2 compatible and that no distro provided, so the dev had to compile it themselves.  That might get better now we no longer use GTK 2.  But the reload_clean_doc_on_file_change should stay hidden IMO.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2859#discussion_r685086456
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20210809/c2d2bfa4/attachment.htm>


More information about the Github-comments mailing list