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

elextr notifications at xxxxx
Mon Aug 9 12:17:24 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))

Ahh, maybe the meaning of keep_edit_history_on_reload is not entirely clear, what it does is it also adds the _reload_ to the edit history, so its undo-able, and all previous edits are also still there.  So you don't "lose" anything because you can undo, but if its off the edit history is cleared because it may not apply to the newly loaded file, and now you can't undo.  In your case above, having it off means that a file with an edit history (even if its saved) may have changes in the buffer that you are about to lose because the file has been overwritten, and you are about to load that over the modified buffer.  So its correct to pop a prompt.  

Saving the reload in undo is unusual behaviour, I'm not aware of any other editor or IDE that does it, and for sure it can use lots of memory if you do a big file lots, thats why the option is there.  But with today's gigabyte memories, outside unusual use-cases like watching large logs that update often, its better to operate with keep_edit_history_on_reload setting on, which is the default.

-- 
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_r685141887
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20210809/b04e6512/attachment.htm>


More information about the Github-comments mailing list