]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix treesit--children-covering-range-recurse (bug#60301)
authorYuan Fu <casouri@gmail.com>
Sun, 25 Dec 2022 02:45:36 +0000 (18:45 -0800)
committerYuan Fu <casouri@gmail.com>
Sun, 25 Dec 2022 02:46:04 +0000 (18:46 -0800)
* lisp/treesit.el (treesit--children-covering-range-recurse): Always
return a list of node.

lisp/treesit.el

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