Fix treesit--children-covering-range-recurse (bug#60301)

* lisp/treesit.el (treesit--children-covering-range-recurse): Always
return a list of node.
This commit is contained in:
Yuan Fu 2022-12-24 18:45:36 -08:00
parent fbb4eb919b
commit a24e350170
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View file

@ -865,7 +865,7 @@ LIMIT is the recursion limit, which defaults to 100."
(push child result)) (push child result))
(setq child (treesit-node-next-sibling child))) (setq child (treesit-node-next-sibling child)))
;; If NODE has no child, keep NODE. ;; If NODE has no child, keep NODE.
(or result node))) (or result (list node))))
(defsubst treesit--node-length (node) (defsubst treesit--node-length (node)
"Return the length of the text of NODE." "Return the length of the text of NODE."