From 53292c5d8186dfac5c82b0d16a10d91c691ae75f Mon Sep 17 00:00:00 2001 From: nverno Date: Sat, 7 Oct 2023 19:36:44 -0700 Subject: [PATCH] Fix treesit-query-validate for string input (bug#66400) * lisp/treesit.el (treesit-query-validate): Don't expand if QUERY is string. --- lisp/treesit.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/treesit.el b/lisp/treesit.el index 98eac7f6d63..e8d57dfcd06 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -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) -- 2.39.2