Branch: refs/heads/master Author: Enrico Tröger enrico.troeger@uvena.de Committer: Enrico Tröger enrico.troeger@uvena.de Date: Sun, 28 Nov 2021 15:56:54 UTC Commit: 295f59da91d2a2c08a5289d56d30f3caa2d2d507 https://github.com/geany/geany/commit/295f59da91d2a2c08a5289d56d30f3caa2d2d5...
Log Message: ----------- Add a confirmation dialog on search & replace for the whole session
Replacing some text in the whole session can be accidentally clicked too easily and the result might not want the user wanted to do. So ask for confirmation *before* potentially all files in the session will be modified.
Modified Paths: -------------- src/search.c
Modified: src/search.c 9 lines changed, 9 insertions(+), 0 deletions(-) =================================================================== @@ -30,6 +30,7 @@ #include "search.h"
#include "app.h" +#include "dialogs.h" #include "document.h" #include "encodings.h" #include "encodingsprivate.h" @@ -1455,6 +1456,14 @@ on_replace_dialog_response(GtkDialog *dialog, gint response, gpointer user_data) return; }
+ if (response == GEANY_RESPONSE_REPLACE_IN_SESSION) { + if (! dialogs_show_question_full(replace_dlg.dialog, NULL, NULL, + _("This operation will modify all open files which contain the text to replace."), + _("Are you sure to replace in the whole session?"))) { + return; + } + } + search_backwards_re = settings.replace_search_backwards; search_replace_escape_re = settings.replace_escape_sequences; find = g_strdup(gtk_entry_get_text(GTK_ENTRY(replace_dlg.find_entry)));
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).