Quicksearch: expand extended symbols on "Edit", patch by Olivier Brunel.
authorwwp <subscript@free.fr>
Thu, 20 Sep 2018 20:16:33 +0000 (22:16 +0200)
committerwwp <subscript@free.fr>
Thu, 20 Sep 2018 20:16:33 +0000 (22:16 +0200)
src/gtk/quicksearch.c

index ca01473d6f043f14892c2db6d84b04e2a4dbf534..c3485c5c36c1cb0c0f6774264e02b2bb160be832 100644 (file)
@@ -594,12 +594,16 @@ static gboolean search_condition_expr(GtkMenuItem *widget, gpointer data)
                        mainwindow_get_mainwindow()->summaryview->quicksearch != NULL,
                        FALSE);
 
-       /* re-use the current quicksearch value if it's a condition expression,
-          otherwise ignore it silently */
+       /* re-use the current quicksearch value, expanding it so it also works
+        * with extended symbols */
        cond_str = quicksearch_get_text(mainwindow_get_mainwindow()->summaryview->quicksearch);
 
        if (*cond_str != '\0') {
-               matchers = matcher_parser_get_cond((gchar*)cond_str, NULL);
+               gchar *newstr = advsearch_expand_search_string(cond_str);
+
+               if (newstr && newstr[0] != '\0')
+                       matchers = matcher_parser_get_cond(newstr, FALSE);
+               g_free(newstr);
        }
 
        prefs_matcher_open(matchers, search_condition_expr_done);