make get_region_bytecount end-exclusive

This commit is contained in:
chentau
2021-05-06 20:37:09 -07:00
parent a847abc21b
commit 13a9bd006f
3 changed files with 28 additions and 15 deletions

View File

@@ -442,7 +442,7 @@ void nvim_buf_set_lines(uint64_t channel_id,
goto end;
}
bcount_t deleted_bytes = MAX(get_region_bytecount(start, end, 0, 0)-1, 0);
bcount_t deleted_bytes = get_region_bytecount(curbuf, start, end, 0, 0);
// If the size of the range is reducing (ie, new_len < old_len) we
// need to delete some old_len. We do this at the start, by