; * src/treesit.c (treesit_cursor_helper_1): Fix last change.

This commit is contained in:
Eli Zaretskii 2026-07-27 22:14:23 +03:00
parent 5e3f68c669
commit 037076824f

View file

@ -4261,12 +4261,12 @@ treesit_cursor_helper_1 (TSTreeCursor *cursor, TSNode *target,
/* ts_tree_cursor_goto_first_child_for_byte is significantly faster,
so despite it having problems (see bug#60127), we try it first.
Also, ts_tree_cursor_goto_first_child_for_byte can't find
zero-width nodes (which exists and are legit, e.g., markdown's
zero-width nodes (which exist and are legit, e.g., markdown's
block_continuation), because a zero-width node can't contain a pos
(end > pos). */
if (start_pos != end_pos
&& ts_tree_cursor_goto_first_child_for_byte (cursor, start_pos) == -1
&& !ts_tree_cursor_goto_first_child (cursor))
if (!((start_pos != end_pos
&& ts_tree_cursor_goto_first_child_for_byte (cursor, start_pos) != -1)
|| ts_tree_cursor_goto_first_child (cursor)))
return false;
/* Go through each sibling that could contain TARGET. Because of