treesitter: test newly added set_included_ranges

This commit is contained in:
Thomas Vigouroux
2020-06-14 18:50:22 +02:00
parent 333f3f19db
commit ac18403d6e
2 changed files with 43 additions and 2 deletions

View File

@@ -447,8 +447,9 @@ static int parser_set_ranges(lua_State *L) {
}
// TODO: For sure that's wrong, try to find a way to get the byte offset directly
uint32_t start_byte = ml_find_line_or_offset(buf, start_row, NULL, false) + start_col;
uint32_t stop_byte = ml_find_line_or_offset(buf, stop_row, NULL, false) + stop_col;
// Lines are 0 based for consistency
uint32_t start_byte = ml_find_line_or_offset(buf, start_row + 1, NULL, false) + start_col;
uint32_t stop_byte = ml_find_line_or_offset(buf, stop_row + 1, NULL, false) + stop_col;
ranges[index] = (TSRange) {
.start_point = (TSPoint) {