patch 8.1.0037: cannot easily append lines to another buffer
Problem: Cannot easily append lines to another buffer.
Solution: Add appendbufline().
diff --git a/src/testdir/test_bufline.vim b/src/testdir/test_bufline.vim
index b886e99..b110c44 100644
--- a/src/testdir/test_bufline.vim
+++ b/src/testdir/test_bufline.vim
@@ -1,4 +1,4 @@
-" Tests for setbufline() and getbufline()
+" Tests for setbufline(), getbufline(), appendbufline()
source shared.vim
@@ -65,3 +65,28 @@
call delete('Xscript')
call delete('Xtest')
endfunc
+
+func Test_appendbufline()
+ new
+ let b = bufnr('%')
+ hide
+ call assert_equal(0, appendbufline(b, 0, ['foo', 'bar']))
+ call assert_equal(['foo'], getbufline(b, 1))
+ call assert_equal(['bar'], getbufline(b, 2))
+ call assert_equal(['foo', 'bar'], getbufline(b, 1, 2))
+ exe "bd!" b
+ call assert_equal([], getbufline(b, 1, 2))
+
+ split Xtest
+ call setline(1, ['a', 'b', 'c'])
+ let b = bufnr('%')
+ wincmd w
+ call assert_equal(1, appendbufline(b, 4, ['x']))
+ call assert_equal(1, appendbufline(1234, 1, ['x']))
+ call assert_equal(0, appendbufline(b, 3, ['d', 'e']))
+ call assert_equal(['c'], getbufline(b, 3))
+ call assert_equal(['d'], getbufline(b, 4))
+ call assert_equal(['e'], getbufline(b, 5))
+ call assert_equal([], getbufline(b, 6))
+ exe "bwipe! " . b
+endfunc
diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim
index 3af8c4c..ab2fe7c 100644
--- a/src/testdir/test_edit.vim
+++ b/src/testdir/test_edit.vim
@@ -527,7 +527,7 @@
" Tab in completion mode
let path=expand("%:p:h")
new
- call setline(1, [path."/", ''])
+ call setline(1, [path. "/", ''])
call feedkeys("Arunt\<c-x>\<c-f>\<tab>\<cr>\<esc>", 'tnix')
call assert_match('runtest\.vim', getline(1))
%d