[gnome-builder] search: allow searching for some escape sequences without regex



commit 63d060e1e5e78334932e807ada8829cfcbdafd79
Author: Christian Hergert <chergert redhat com>
Date:   Fri Aug 30 15:17:41 2019 -0700

    search: allow searching for some escape sequences without regex
    
    Being able to search for \t and \n without regex is handy, so we'll copy
    what gedit does here and enable it by default.

 src/libide/editor/ide-editor-search.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/libide/editor/ide-editor-search.c b/src/libide/editor/ide-editor-search.c
index 3874ba48d..5aa7b2e8f 100644
--- a/src/libide/editor/ide-editor-search.c
+++ b/src/libide/editor/ide-editor-search.c
@@ -978,8 +978,13 @@ void
 ide_editor_search_set_search_text (IdeEditorSearch *self,
                                    const gchar     *search_text)
 {
+  g_autofree gchar *unescaped = NULL;
+
   g_return_if_fail (IDE_IS_EDITOR_SEARCH (self));
 
+  if (!ide_editor_search_get_regex_enabled (self))
+    search_text = unescaped = gtk_source_utils_unescape_search_text (search_text);
+
   gtk_source_search_settings_set_search_text (self->settings, search_text);
 
   /*


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