fix(lib): do not consider childless nodes for ts_node_parent
This commit is contained in:
parent
f415f0c6f2
commit
ab485da756
1 changed files with 1 additions and 1 deletions
|
|
@ -513,7 +513,7 @@ TSNode ts_node_parent(TSNode self) {
|
|||
ts_node_start_byte(child) > ts_node_start_byte(self) ||
|
||||
child.id == self.id
|
||||
) break;
|
||||
if (iterator.position.bytes >= end_byte) {
|
||||
if (iterator.position.bytes >= end_byte && ts_node_child_count(child) > 0) {
|
||||
node = child;
|
||||
if (ts_node__is_relevant(child, true)) {
|
||||
last_visible_node = node;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue