summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornverno <noah.v.peart@gmail.com>2023-10-07 19:36:44 -0700
committerYuan Fu <casouri@gmail.com>2023-10-08 22:00:32 -0700
commit53292c5d8186dfac5c82b0d16a10d91c691ae75f (patch)
tree8b10b5339a5c11d784270c4edc09c3ed6b7ba000
parent81a0c1ed2e437f94edaef0c9d3b5740d36f47181 (diff)
downloademacs-53292c5d8186dfac5c82b0d16a10d91c691ae75f.tar.gz
Fix treesit-query-validate for string input (bug#66400)
* lisp/treesit.el (treesit-query-validate): Don't expand if QUERY is string.
-rw-r--r--lisp/treesit.el4
1 files changed, 3 insertions, 1 deletions
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)