Fix treesit-query-validate for string input (bug#66400)

* lisp/treesit.el (treesit-query-validate): Don't expand if QUERY is
string.
This commit is contained in:
nverno 2023-10-07 19:36:44 -07:00 committed by Yuan Fu
parent 81a0c1ed2e
commit 53292c5d81
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View 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)