emacs-31 037076824f1: ; * src/treesit.c (treesit_cursor_helper_1): Fix last change.
Eli Zaretskii <[email protected]> Mon, 27 Jul 2026 15:15:23 -0400 (EDT)
| Newsgroups | gmane.emacs.diffs |
|---|---|
| Message-ID | <[email protected]> |
branch: emacs-31 commit 037076824f1399dd8c64fac1646ecd2ba53bdb39 Author: Eli Zaretskii <[email protected]> Commit: Eli Zaretskii <[email protected]> ; * src/treesit.c (treesit_cursor_helper_1): Fix last change. --- src/treesit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/treesit.c b/src/treesit.c index 84103473387..210fae671b3 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -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