[gnome-builder/gnome-builder-3-32] search: allow searching for some escape sequences without regex
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-32] search: allow searching for some escape sequences without regex
- Date: Fri, 30 Aug 2019 23:03:05 +0000 (UTC)
commit de10cac54f9e002fe52cc2c0109ca5a6f4d9e52b
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]