Include rows and columns in TSLength

This way, we don't have to have separate 1D and 2D versions for so many values
This commit is contained in:
Max Brunsfeld 2015-12-04 20:20:29 -08:00
parent 22c76fc71b
commit d2bf88d5fe
14 changed files with 186 additions and 241 deletions

View file

@ -53,7 +53,7 @@ void ts_document_edit(TSDocument *self, TSInputEdit edit) {
if (!self->tree)
return;
size_t max_chars = ts_tree_total_size(self->tree).chars;
size_t max_chars = ts_tree_total_chars(self->tree);
if (edit.position > max_chars)
edit.position = max_chars;
if (edit.chars_removed > max_chars - edit.position)