; * lisp/treesit.el (treesit-node-top-level): cleaner and faster
This commit is contained in:
parent
56468b52b2
commit
a85609c22d
1 changed files with 1 additions and 2 deletions
|
@ -251,8 +251,7 @@ than using NODE's type. PRED can also be a predicate function,
|
|||
and more. See `treesit-thing-settings' for details.
|
||||
|
||||
If INCLUDE-NODE is non-nil, return NODE if it satisfies PRED."
|
||||
(let ((pred (or pred (rx-to-string
|
||||
`(seq bos ,(treesit-node-type node) eos))))
|
||||
(let ((pred (or pred (rx bos (literal (treesit-node-type node)) eos)))
|
||||
(result nil))
|
||||
(cl-loop for cursor = (if include-node node
|
||||
(treesit-node-parent node))
|
||||
|
|
Loading…
Add table
Reference in a new issue