[gnome-text-editor] searchbar: unescape text for replacement



commit 83ea76355ec11bd55587af4b29bd0309b5b9a617
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jul 27 18:20:54 2021 -0700

    searchbar: unescape text for replacement

 src/editor-search-bar.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/editor-search-bar.c b/src/editor-search-bar.c
index eeb063c..e5627fd 100644
--- a/src/editor-search-bar.c
+++ b/src/editor-search-bar.c
@@ -757,6 +757,7 @@ void
 _editor_search_bar_replace_all (EditorSearchBar *self)
 {
   g_autoptr(GError) error = NULL;
+  g_autofree char *unescaped = NULL;
   const char *replace;
 
   g_return_if_fail (EDITOR_IS_SEARCH_BAR (self));
@@ -765,7 +766,8 @@ _editor_search_bar_replace_all (EditorSearchBar *self)
     return;
 
   replace = gtk_editable_get_text (GTK_EDITABLE (self->replace_entry));
+  unescaped = gtk_source_utils_unescape_search_text (replace);
 
-  if (!gtk_source_search_context_replace_all (self->context, replace, -1, &error))
+  if (!gtk_source_search_context_replace_all (self->context, unescaped, -1, &error))
     g_warning ("Failed to replace all matches: %s", error->message);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]