From: Yuan Fu Date: Tue, 17 Jan 2023 04:32:15 +0000 (-0800) Subject: ; * src/treesit.c (Ftreesit_induce_sparse_tree): Minor change. X-Git-Tag: emacs-29.0.90~703 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b36cc7e7bbb5a8d0c1b298b89a4cb562af746ecc;p=emacs.git ; * src/treesit.c (Ftreesit_induce_sparse_tree): Minor change. --- diff --git a/src/treesit.c b/src/treesit.c index 3886fed346e..adbed1427be 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -3270,9 +3270,9 @@ a regexp. */) Lisp_Object parser = XTS_NODE (root)->parser; Lisp_Object parent = Fcons (Qnil, Qnil); - TSTreeCursor cursor; - if (!treesit_cursor_helper (&cursor, XTS_NODE (root)->node, parser)) - return Qnil; + /* In this function we never traverse above NODE, so we don't need + to use treesit_cursor_helper. */ + TSTreeCursor cursor = ts_tree_cursor_new (XTS_NODE (root)->node); treesit_build_sparse_tree (&cursor, parent, predicate, process_fn, the_limit, parser);