Correct cursor range in Ftreesit_query_capture (bug#81297)

* src/treesit.c (Ftreesit_query_capture): Always explicitly set
cursor's range.
This commit is contained in:
Yuan Fu 2026-06-30 22:28:50 -07:00
parent a057a32bf9
commit 5dd8fe25c2
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View file

@ -4106,6 +4106,12 @@ the query. */)
(uint32_t) (beg_byte - visible_beg),
(uint32_t) (end_byte - visible_beg));
}
else
{
/* If range is unbounded, set it explicitly, in case the cursor is
reused and carries the range from last call. */
ts_query_cursor_set_byte_range (cursor, 0, UINT32_MAX);
}
/* Execute query. */
ts_query_cursor_exec (cursor, treesit_query, treesit_node);