]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix treesit-query-validate for string input (bug#66400)
authornverno <noah.v.peart@gmail.com>
Sun, 8 Oct 2023 02:36:44 +0000 (19:36 -0700)
committerYuan Fu <casouri@gmail.com>
Mon, 9 Oct 2023 05:00:32 +0000 (22:00 -0700)
* lisp/treesit.el (treesit-query-validate): Don't expand if QUERY is
string.

lisp/treesit.el

index 98eac7f6d639caaa6be527b1f06d71420c5e65fa..e8d57dfcd060b2b361d2f63a7aedefadeb182d3b 100644 (file)
@@ -2528,7 +2528,9 @@ to the offending pattern and highlight the pattern."
                   (start (nth 1 data))
                   (inhibit-read-only t))
              (erase-buffer)
-             (insert (treesit-query-expand query))
+             (insert (if (stringp query)
+                         query
+                       (treesit-query-expand query)))
              (goto-char start)
              (search-forward " " nil t)
              (put-text-property start (point) 'face 'error)