diff options
-rw-r--r-- | src/treesit.c | 6 |
1 files 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); |