Store nodes' public-facing positions, not pre-padding positions

This commit is contained in:
Max Brunsfeld 2018-05-22 08:50:04 -07:00
parent 8d57ce9cdf
commit 80630ce504
3 changed files with 20 additions and 26 deletions

View file

@ -184,5 +184,10 @@ TSNode ts_tree_cursor_current_node(const TSTreeCursor *_self) {
alias_symbol = alias_sequence[last_entry->structural_child_index];
}
}
return ts_node_new(self->tree, last_entry->subtree, last_entry->position, alias_symbol);
return ts_node_new(
self->tree,
last_entry->subtree,
length_add(last_entry->position, last_entry->subtree->padding),
alias_symbol
);
}