Fix error in handling of padding in get_changed_ranges
This commit is contained in:
parent
f3c3fd3c9e
commit
1e04489e50
2 changed files with 8 additions and 2 deletions
|
|
@ -94,6 +94,10 @@ void ts_document_edit(TSDocument *self, TSInputEdit edit) {
|
|||
edit.bytes_removed = max_bytes - edit.start_byte;
|
||||
|
||||
ts_tree_edit(self->tree, &edit);
|
||||
|
||||
if (self->parser.print_debugging_graphs) {
|
||||
ts_tree_print_dot_graph(self->tree, self->parser.language, stderr);
|
||||
}
|
||||
}
|
||||
|
||||
void ts_document_parse(TSDocument *self) {
|
||||
|
|
|
|||
|
|
@ -85,7 +85,8 @@ static void iterator_get_visible_state(const Iterator *self, Tree **tree,
|
|||
uint32_t i = self->path.size - 1;
|
||||
|
||||
if (self->in_padding) {
|
||||
while (self->path.contents[i].child_index == 0) i--;
|
||||
if (i == 0) return;
|
||||
i--;
|
||||
}
|
||||
|
||||
for (; i + 1 > 0; i--) {
|
||||
|
|
@ -218,7 +219,8 @@ IteratorComparison iterator_compare(const Iterator *old_iter, const Iterator *ne
|
|||
iterator_get_visible_state(old_iter, &old_tree, &old_alias_symbol, &old_start);
|
||||
iterator_get_visible_state(new_iter, &new_tree, &new_alias_symbol, &new_start);
|
||||
|
||||
assert(old_tree && new_tree);
|
||||
if (!old_tree && !new_tree) return IteratorMatches;
|
||||
if (!old_tree || !new_tree) return IteratorDiffers;
|
||||
|
||||
if (old_alias_symbol == new_alias_symbol) {
|
||||
if (old_start == new_start) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue