From b36cc7e7bbb5a8d0c1b298b89a4cb562af746ecc Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Mon, 16 Jan 2023 20:32:15 -0800 Subject: [PATCH] ; * src/treesit.c (Ftreesit_induce_sparse_tree): Minor change. --- src/treesit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); -- 2.39.2