summaryrefslogtreecommitdiff
path: root/lisp/treesit.el
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2023-02-18 23:52:47 +0200
committerDmitry Gutov <dgutov@yandex.ru>2023-02-18 23:53:11 +0200
commit4c49452cdef9721715838590aff175ef596a08b2 (patch)
treec5bcf84c2b76efc258a6b8838417dc8a3f9fc60f /lisp/treesit.el
parentd560dc5044a69144e45e13ee787b196afa28ba8b (diff)
downloademacs-4c49452cdef9721715838590aff175ef596a08b2.tar.gz
(treesit-query-validate): Fix reusing the output buffer
* lisp/treesit.el (treesit-query-validate): Fix the "Buffer is read-only" error when an output buffer already exists.
Diffstat (limited to 'lisp/treesit.el')
-rw-r--r--lisp/treesit.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 09531b838a1..b71b5b486d5 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -2380,7 +2380,8 @@ to the offending pattern and highlight the pattern."
(with-current-buffer buf
(let* ((data (cdr err))
(message (nth 0 data))
- (start (nth 1 data)))
+ (start (nth 1 data))
+ (inhibit-read-only t))
(erase-buffer)
(insert (treesit-query-expand query))
(goto-char start)