mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-04 11:23:24 +00:00
Don't signal an error in treesit-node-at
* lisp/treesit.el (treesit-node-at): Wrap treesit-buffer-root-node within condition-case.
This commit is contained in:
parent
5d021a711a
commit
a9cde2463a
1 changed files with 5 additions and 3 deletions
|
@ -213,9 +213,11 @@ language and doesn't match the language of the local parser."
|
||||||
(car (treesit-local-parsers-at
|
(car (treesit-local-parsers-at
|
||||||
pos parser-or-lang))))
|
pos parser-or-lang))))
|
||||||
(treesit-parser-root-node parser))
|
(treesit-parser-root-node parser))
|
||||||
(treesit-buffer-root-node
|
(condition-case nil
|
||||||
(or parser-or-lang
|
(treesit-buffer-root-node
|
||||||
(treesit-language-at pos))))))
|
(or parser-or-lang
|
||||||
|
(treesit-language-at pos)))
|
||||||
|
(treesit-no-parser nil)))))
|
||||||
(node root)
|
(node root)
|
||||||
(node-before root)
|
(node-before root)
|
||||||
(pos-1 (max (1- pos) (point-min)))
|
(pos-1 (max (1- pos) (point-min)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue