Mercurial > vim
comparison src/testdir/test_display.vim @ 17614:d7708560b77c v8.1.1804
patch 8.1.1804: no test for display updating without a scroll region
commit https://github.com/vim/vim/commit/3c8ee629745737aa231fdd123826ae021e398e49
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 3 22:55:50 2019 +0200
patch 8.1.1804: no test for display updating without a scroll region
Problem: No test for display updating without a scroll region.
Solution: Add a test.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 03 Aug 2019 23:00:06 +0200 |
parents | 2dcaa860e3fc |
children | 9695e9fed059 |
comparison
equal
deleted
inserted
replaced
17613:bc8071d1d2fc | 17614:d7708560b77c |
---|---|
2 if !has('gui_running') && has('unix') | 2 if !has('gui_running') && has('unix') |
3 set term=ansi | 3 set term=ansi |
4 endif | 4 endif |
5 | 5 |
6 source view_util.vim | 6 source view_util.vim |
7 source check.vim | |
8 source screendump.vim | |
7 | 9 |
8 func Test_display_foldcolumn() | 10 func Test_display_foldcolumn() |
9 if !has("folding") | 11 CheckFeature folding |
10 return | 12 |
11 endif | |
12 new | 13 new |
13 vnew | 14 vnew |
14 vert resize 25 | 15 vert resize 25 |
15 call assert_equal(25, winwidth(winnr())) | 16 call assert_equal(25, winwidth(winnr())) |
16 set isprint=@ | 17 set isprint=@ |
22 \ "> more stuff here " | 23 \ "> more stuff here " |
23 \ ] | 24 \ ] |
24 | 25 |
25 call cursor(2, 1) | 26 call cursor(2, 1) |
26 norm! zt | 27 norm! zt |
27 let lines=ScreenLines([1,2], winwidth(0)) | 28 let lines = ScreenLines([1,2], winwidth(0)) |
28 call assert_equal(expect, lines) | 29 call assert_equal(expect, lines) |
29 set fdc=2 | 30 set fdc=2 |
30 let lines=ScreenLines([1,2], winwidth(0)) | 31 let lines = ScreenLines([1,2], winwidth(0)) |
31 let expect = [ | 32 let expect = [ |
32 \ " e more noise blah blah<", | 33 \ " e more noise blah blah<", |
33 \ " 82> more stuff here " | 34 \ " 82> more stuff here " |
34 \ ] | 35 \ ] |
35 call assert_equal(expect, lines) | 36 call assert_equal(expect, lines) |
37 quit! | 38 quit! |
38 quit! | 39 quit! |
39 endfunc | 40 endfunc |
40 | 41 |
41 func Test_display_foldtext_mbyte() | 42 func Test_display_foldtext_mbyte() |
42 if !has("folding") | 43 CheckFeature folding |
43 return | 44 |
44 endif | |
45 call NewWindow(10, 40) | 45 call NewWindow(10, 40) |
46 call append(0, range(1,20)) | 46 call append(0, range(1,20)) |
47 exe "set foldmethod=manual foldtext=foldtext() fillchars=fold:\u2500,vert:\u2502 fdc=2" | 47 exe "set foldmethod=manual foldtext=foldtext() fillchars=fold:\u2500,vert:\u2502 fdc=2" |
48 call cursor(2, 1) | 48 call cursor(2, 1) |
49 norm! zf13G | 49 norm! zf13G |
65 call assert_equal(expect, lines) | 65 call assert_equal(expect, lines) |
66 | 66 |
67 set foldtext& fillchars& foldmethod& fdc& | 67 set foldtext& fillchars& foldmethod& fdc& |
68 bw! | 68 bw! |
69 endfunc | 69 endfunc |
70 | |
71 " check that win_ins_lines() and win_del_lines() work when t_cs is empty. | |
72 func Test_scroll_without_region() | |
73 CheckScreendump | |
74 | |
75 let lines =<< trim END | |
76 call setline(1, range(1, 20)) | |
77 set t_cs= | |
78 set laststatus=2 | |
79 END | |
80 call writefile(lines, 'Xtestscroll') | |
81 let buf = RunVimInTerminal('-S Xtestscroll', #{rows: 10}) | |
82 | |
83 call VerifyScreenDump(buf, 'Test_scroll_no_region_1', {}) | |
84 | |
85 call term_sendkeys(buf, ":3delete\<cr>") | |
86 call VerifyScreenDump(buf, 'Test_scroll_no_region_2', {}) | |
87 | |
88 call term_sendkeys(buf, ":4put\<cr>") | |
89 call VerifyScreenDump(buf, 'Test_scroll_no_region_3', {}) | |
90 | |
91 " clean up | |
92 call StopVimInTerminal(buf) | |
93 call delete('Xtestscroll') | |
94 endfunc |