aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/treesit.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 36f26ea5825..2d8eebbbff5 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -4525,7 +4525,7 @@ in the region."
4525 (<= (treesit-node-end n) end)) 4525 (<= (treesit-node-end n) end))
4526 t t))))) 4526 t t)))))
4527 4527
4528(defun treesit--explorer-refresh () 4528(defun treesit--explorer-refresh-1 ()
4529 "Update the syntax tree buffer." 4529 "Update the syntax tree buffer."
4530 (when (and treesit-explore-mode 4530 (when (and treesit-explore-mode
4531 (buffer-live-p treesit--explorer-buffer)) 4531 (buffer-live-p treesit--explorer-buffer))
@@ -4576,6 +4576,19 @@ in the region."
4576 (set-window-start window (point)))) 4576 (set-window-start window (point))))
4577 (set-window-point window pos))))))) 4577 (set-window-point window pos)))))))
4578 4578
4579(defun treesit--explorer-refresh ()
4580 "Update the syntax tree buffer."
4581 (condition-case nil
4582 (treesit--explorer-refresh-1)
4583 (treesit-parser-deleted
4584 (when treesit--explorer-buffer
4585 (with-current-buffer treesit--explorer-buffer
4586 (let ((inhibit-read-only t))
4587 (goto-char (point-min))
4588 (unless (looking-at "Parser is deleted")
4589 (insert (propertize "Parser is deleted\n"
4590 'face 'error)))))))))
4591
4579(defun treesit--explorer-post-command (&rest _) 4592(defun treesit--explorer-post-command (&rest _)
4580 "Post-command function that runs in the source buffer." 4593 "Post-command function that runs in the source buffer."
4581 (when treesit-explore-mode 4594 (when treesit-explore-mode