From 13a9bd006f08819184963b61909f0595321adc51 Mon Sep 17 00:00:00 2001 From: chentau Date: Thu, 6 May 2021 20:37:09 -0700 Subject: make get_region_bytecount end-exclusive --- src/nvim/api/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/api') diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index a396693a61..665c622c98 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -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 -- cgit