Skip to content

Commit

Permalink
Merge pull request geany#3033 from eht16/add_confirmation_on_session_…
Browse files Browse the repository at this point in the history
…replace

Add a confirmation dialog on search & replace for the whole session
  • Loading branch information
eht16 committed Feb 13, 2022
2 parents b3e0cfb + 295f59d commit da12533
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/search.c
Expand Up @@ -30,6 +30,7 @@
#include "search.h"

#include "app.h"
#include "dialogs.h"
#include "document.h"
#include "encodings.h"
#include "encodingsprivate.h"
Expand Down Expand Up @@ -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)));
Expand Down

0 comments on commit da12533

Please sign in to comment.