From 4fedef51b0bdb641432422b93dd5f3886f3e4283 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 24 Aug 2019 14:02:51 -0400 Subject: vim-patch:8.1.1757: text added with appendbufline() isn't displayed Problem: Text added with appendbufline() to another buffer isn't displayed. Solution: Update topline. (partly by Christian Brabandt, closes vim/vim#4718) https://github.com/vim/vim/commit/298466629119eda501cfdf7824797f05045e67ca --- src/nvim/testdir/test_bufline.vim | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_bufline.vim b/src/nvim/testdir/test_bufline.vim index 1f83e8b776..a924ce0002 100644 --- a/src/nvim/testdir/test_bufline.vim +++ b/src/nvim/testdir/test_bufline.vim @@ -1,6 +1,7 @@ " Tests for setbufline(), getbufline(), appendbufline(), deletebufline() source shared.vim +" source screendump.vim func Test_setbufline_getbufline() new @@ -112,3 +113,28 @@ func Test_deletebufline() call assert_equal(['b', 'c'], getbufline(b, 1, 2)) exe "bwipe! " . b endfunc + +func Test_appendbufline_redraw() + if !CanRunVimInTerminal() + throw 'Skipped: cannot make screendumps' + endif + let lines =<< trim END + new foo + let winnr=bufwinnr('foo') + let buf=bufnr('foo') + wincmd p + call appendbufline(buf, '$', range(1,200)) + exe winnr. 'wincmd w' + norm! G + wincmd p + call deletebufline(buf, 1, '$') + call appendbufline(buf, '$', 'Hello Vim world...') + END + call writefile(lines, 'XscriptMatchCommon') + let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 10}) + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_appendbufline_1', {}) + + call StopVimInTerminal(buf) + call delete('XscriptMatchCommon') +endfunc -- cgit From 66c06dad62638106fadad389f585dc11f482c6b1 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 24 Aug 2019 20:48:35 -0400 Subject: vim-patch:8.1.1924: using empty string for current buffer is unexpected Problem: Using empty string for current buffer is unexpected. Solution: Make the argument optional for bufname() and bufnr(). https://github.com/vim/vim/commit/a8eee21e75324d199acb1663cb5009e03014a13a --- src/nvim/testdir/test_arglist.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_arglist.vim b/src/nvim/testdir/test_arglist.vim index df72ff0a32..6e7583ade3 100644 --- a/src/nvim/testdir/test_arglist.vim +++ b/src/nvim/testdir/test_arglist.vim @@ -379,10 +379,10 @@ func Test_argedit() " make sure to use a new buffer number for x when it is loaded bw! x new - let a = bufnr('') + let a = bufnr() argedit x - call assert_equal(a, bufnr('')) - call assert_equal('x', bufname('')) + call assert_equal(a, bufnr()) + call assert_equal('x', bufname()) %argd bw! x endfunc -- cgit