From: Yuan Fu Date: Wed, 26 Oct 2022 05:48:30 +0000 (-0700) Subject: * src/treesit.c (treesit_search_dfs): Fix traverse algorithm. X-Git-Tag: emacs-29.0.90~1784 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e868955bff3b97bad88bd09b4401e87cab94011c;p=emacs.git * src/treesit.c (treesit_search_dfs): Fix traverse algorithm. --- diff --git a/src/treesit.c b/src/treesit.c index 0f949b75542..cd1af3f52d6 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -2455,7 +2455,8 @@ treesit_search_dfs (TSNode *root, Lisp_Object pred, Lisp_Object parser, for (int offset = 0; offset < count; offset++) { uint32_t idx = forward ? offset : count - offset - 1; - TSNode child = ts_node_child (node, idx); + TSNode child = + named ? ts_node_named_child (node, idx) : ts_node_child (node, idx); if (!ts_node_is_null (child) && treesit_search_dfs (&child, pred, parser, named,