feat(lib)!: treat nodes' end ranges exclusively in goto_first_child_for_{byte,point}

This goes back on #1640, because now cursors are bi-directional, and
going to the previous sibling is simple.
This commit is contained in:
Jeong, Hun 2024-04-07 09:29:58 -07:00 committed by Amaan Qureshi
parent b36ef4b7f4
commit bbc1370dd5
2 changed files with 5 additions and 4 deletions

View file

@ -274,7 +274,7 @@ static inline int64_t ts_tree_cursor_goto_first_child_for_byte_and_point(
CursorChildIterator iterator = ts_tree_cursor_iterate_children(self);
while (ts_tree_cursor_child_iterator_next(&iterator, &entry, &visible)) {
Length entry_end = length_add(entry.position, ts_subtree_size(*entry.subtree));
bool at_goal = entry_end.bytes >= goal_byte && point_gte(entry_end.extent, goal_point);
bool at_goal = entry_end.bytes > goal_byte && point_gt(entry_end.extent, goal_point);
uint32_t visible_child_count = ts_subtree_visible_child_count(*entry.subtree);
if (at_goal) {
if (visible) {