From 8ab09087dabc72e10a80f2fe3fedcbdfb7abb39a Mon Sep 17 00:00:00 2001 From: Enrico Ghirardi Date: Sun, 20 Sep 2015 12:37:42 +0200 Subject: Fix append() without line argument We want to switch include_start/end when the index is positive or negative. --- src/nvim/api/buffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/api/buffer.c') diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index ce3e64def8..a8446265d0 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -467,7 +467,8 @@ void buffer_insert(Buffer buffer, ArrayOf(String) lines, Error *err) { - buffer_set_line_slice(buffer, lnum, lnum, true, false, lines, err); + bool end_start = lnum < 0; + buffer_set_line_slice(buffer, lnum, lnum, !end_start, end_start, lines, err); } /// Return a tuple (row,col) representing the position of the named mark -- cgit