Mercurial > vim
comparison src/testdir/test_bufline.vim @ 17518:bfc5a2962f38 v8.1.1757
patch 8.1.1757: text added with appendbufline() isn't displayed
commit https://github.com/vim/vim/commit/298466629119eda501cfdf7824797f05045e67ca
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 27 17:39:15 2019 +0200
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 https://github.com/vim/vim/issues/4718)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 27 Jul 2019 17:45:08 +0200 |
parents | 9c90cf08cfa8 |
children | 0da9bc55c31a |
comparison
equal
deleted
inserted
replaced
17517:965cea692a12 | 17518:bfc5a2962f38 |
---|---|
1 " Tests for setbufline(), getbufline(), appendbufline(), deletebufline() | 1 " Tests for setbufline(), getbufline(), appendbufline(), deletebufline() |
2 | 2 |
3 source shared.vim | 3 source shared.vim |
4 source screendump.vim | |
4 | 5 |
5 func Test_setbufline_getbufline() | 6 func Test_setbufline_getbufline() |
6 new | 7 new |
7 let b = bufnr('%') | 8 let b = bufnr('%') |
8 hide | 9 hide |
142 call assert_equal(1, deletebufline(b, 4)) | 143 call assert_equal(1, deletebufline(b, 4)) |
143 call assert_equal(0, deletebufline(b, 1)) | 144 call assert_equal(0, deletebufline(b, 1)) |
144 call assert_equal(['b', 'c'], getbufline(b, 1, 2)) | 145 call assert_equal(['b', 'c'], getbufline(b, 1, 2)) |
145 exe "bwipe! " . b | 146 exe "bwipe! " . b |
146 endfunc | 147 endfunc |
148 | |
149 func Test_appendbufline_redraw() | |
150 if !CanRunVimInTerminal() | |
151 throw 'Skipped: cannot make screendumps' | |
152 endif | |
153 let lines =<< trim END | |
154 new foo | |
155 let winnr=bufwinnr('foo') | |
156 let buf=bufnr('foo') | |
157 wincmd p | |
158 call appendbufline(buf, '$', range(1,200)) | |
159 exe winnr. 'wincmd w' | |
160 norm! G | |
161 wincmd p | |
162 call deletebufline(buf, 1, '$') | |
163 call appendbufline(buf, '$', 'Hello Vim world...') | |
164 END | |
165 call writefile(lines, 'XscriptMatchCommon') | |
166 let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 10}) | |
167 call term_wait(buf) | |
168 call VerifyScreenDump(buf, 'Test_appendbufline_1', {}) | |
169 | |
170 call StopVimInTerminal(buf) | |
171 call delete('XscriptMatchCommon') | |
172 endfunc |