aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/buffer.c
diff options
context:
space:
mode:
authorchentau <tchen1998@gmail.com>2021-05-06 20:37:09 -0700
committerchentau <tchen1998@gmail.com>2021-05-09 16:23:01 -0700
commit13a9bd006f08819184963b61909f0595321adc51 (patch)
tree9618b3f0ffad35b4c97540707461a9137d0ebd35 /src/nvim/api/buffer.c
parenta847abc21b339a8402d39cc2736f3f73e4f2f124 (diff)
downloadrneovim-13a9bd006f08819184963b61909f0595321adc51.tar.gz
rneovim-13a9bd006f08819184963b61909f0595321adc51.tar.bz2
rneovim-13a9bd006f08819184963b61909f0595321adc51.zip
make get_region_bytecount end-exclusive
Diffstat (limited to 'src/nvim/api/buffer.c')
-rw-r--r--src/nvim/api/buffer.c2
1 files changed, 1 insertions, 1 deletions
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