Mercurial > vim
annotate src/testdir/test_display.vim @ 19738:0208534b8a84 v8.2.0425
patch 8.2.0425: code for modeless selection not sufficiently tested
Commit: https://github.com/vim/vim/commit/515545e11f523d14343b1e588dc0b9bd3d362bc2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 22 14:08:59 2020 +0100
patch 8.2.0425: code for modeless selection not sufficiently tested
Problem: Code for modeless selection not sufficiently tested.
Solution: Add tests. Move mouse code functionality to a common script file.
(Yegappan Lakshmanan, closes #5821)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 22 Mar 2020 14:15:04 +0100 |
parents | 623afba3566a |
children | c9cc9e5c87e0 |
rev | line source |
---|---|
10466
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test for displaying stuff |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 if !has('gui_running') && has('unix') |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 set term=ansi |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 endif |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 |
11265
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
6 source view_util.vim |
17614
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
7 source check.vim |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
8 source screendump.vim |
10466
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
11277
diff
changeset
|
10 func Test_display_foldcolumn() |
17614
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
11 CheckFeature folding |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
12 |
10466
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 new |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 vnew |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 vert resize 25 |
10470
232a0d1d8f24
commit https://github.com/vim/vim/commit/7089237885218eb8a19805bc2b75481c4efcd6ba
Christian Brabandt <cb@256bit.org>
parents:
10466
diff
changeset
|
16 call assert_equal(25, winwidth(winnr())) |
232a0d1d8f24
commit https://github.com/vim/vim/commit/7089237885218eb8a19805bc2b75481c4efcd6ba
Christian Brabandt <cb@256bit.org>
parents:
10466
diff
changeset
|
17 set isprint=@ |
10466
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 1put='e more noise blah blah‚ more stuff here' |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 |
11265
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
21 let expect = [ |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
22 \ "e more noise blah blah<82", |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
23 \ "> more stuff here " |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
24 \ ] |
10466
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 call cursor(2, 1) |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 norm! zt |
17614
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
28 let lines = ScreenLines([1,2], winwidth(0)) |
11265
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
29 call assert_equal(expect, lines) |
10466
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 set fdc=2 |
17614
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
31 let lines = ScreenLines([1,2], winwidth(0)) |
11265
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
32 let expect = [ |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
33 \ " e more noise blah blah<", |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
34 \ " 82> more stuff here " |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
35 \ ] |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
36 call assert_equal(expect, lines) |
10466
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 quit! |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 quit! |
11265
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
40 endfunc |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
41 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
11277
diff
changeset
|
42 func Test_display_foldtext_mbyte() |
17614
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
43 CheckFeature folding |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
44 |
11265
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
45 call NewWindow(10, 40) |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
46 call append(0, range(1,20)) |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
47 exe "set foldmethod=manual foldtext=foldtext() fillchars=fold:\u2500,vert:\u2502 fdc=2" |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
48 call cursor(2, 1) |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
49 norm! zf13G |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
50 let lines=ScreenLines([1,3], winwidth(0)+1) |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
51 let expect=[ |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
52 \ " 1 \u2502", |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
53 \ "+ +-- 12 lines: 2". repeat("\u2500", 23). "\u2502", |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
54 \ " 14 \u2502", |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
55 \ ] |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
56 call assert_equal(expect, lines) |
11277
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
57 |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
58 set fillchars=fold:-,vert:\| |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
59 let lines=ScreenLines([1,3], winwidth(0)+1) |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
60 let expect=[ |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
61 \ " 1 |", |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
62 \ "+ +-- 12 lines: 2". repeat("-", 23). "|", |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
63 \ " 14 |", |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
64 \ ] |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
65 call assert_equal(expect, lines) |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
66 |
11265
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
67 set foldtext& fillchars& foldmethod& fdc& |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
68 bw! |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
69 endfunc |
17614
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
70 |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
71 " check that win_ins_lines() and win_del_lines() work when t_cs is empty. |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
72 func Test_scroll_without_region() |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
73 CheckScreendump |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
74 |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
75 let lines =<< trim END |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
76 call setline(1, range(1, 20)) |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
77 set t_cs= |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
78 set laststatus=2 |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
79 END |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
80 call writefile(lines, 'Xtestscroll') |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
81 let buf = RunVimInTerminal('-S Xtestscroll', #{rows: 10}) |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
82 |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
83 call VerifyScreenDump(buf, 'Test_scroll_no_region_1', {}) |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
84 |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
85 call term_sendkeys(buf, ":3delete\<cr>") |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
86 call VerifyScreenDump(buf, 'Test_scroll_no_region_2', {}) |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
87 |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
88 call term_sendkeys(buf, ":4put\<cr>") |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
89 call VerifyScreenDump(buf, 'Test_scroll_no_region_3', {}) |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
90 |
17618
9695e9fed059
patch 8.1.1806: test for display updating doesn't check without statusline
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
91 call term_sendkeys(buf, ":undo\<cr>") |
9695e9fed059
patch 8.1.1806: test for display updating doesn't check without statusline
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
92 call term_sendkeys(buf, ":undo\<cr>") |
9695e9fed059
patch 8.1.1806: test for display updating doesn't check without statusline
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
93 call term_sendkeys(buf, ":set laststatus=0\<cr>") |
9695e9fed059
patch 8.1.1806: test for display updating doesn't check without statusline
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
94 call VerifyScreenDump(buf, 'Test_scroll_no_region_4', {}) |
9695e9fed059
patch 8.1.1806: test for display updating doesn't check without statusline
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
95 |
9695e9fed059
patch 8.1.1806: test for display updating doesn't check without statusline
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
96 call term_sendkeys(buf, ":3delete\<cr>") |
9695e9fed059
patch 8.1.1806: test for display updating doesn't check without statusline
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
97 call VerifyScreenDump(buf, 'Test_scroll_no_region_5', {}) |
9695e9fed059
patch 8.1.1806: test for display updating doesn't check without statusline
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
98 |
9695e9fed059
patch 8.1.1806: test for display updating doesn't check without statusline
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
99 call term_sendkeys(buf, ":4put\<cr>") |
9695e9fed059
patch 8.1.1806: test for display updating doesn't check without statusline
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
100 call VerifyScreenDump(buf, 'Test_scroll_no_region_6', {}) |
9695e9fed059
patch 8.1.1806: test for display updating doesn't check without statusline
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
101 |
17614
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
102 " clean up |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
103 call StopVimInTerminal(buf) |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
104 call delete('Xtestscroll') |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
105 endfunc |
18131
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
106 |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
107 func Test_display_listchars_precedes() |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
108 call NewWindow(10, 10) |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
109 " Need a physical line that wraps over the complete |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
110 " window size |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
111 call append(0, repeat('aaa aaa aa ', 10)) |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
112 call append(1, repeat(['bbb bbb bbb bbb'], 2)) |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
113 " remove blank trailing line |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
114 $d |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
115 set list nowrap |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
116 call cursor(1, 1) |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
117 " move to end of line and scroll 2 characters back |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
118 norm! $2zh |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
119 let lines=ScreenLines([1,4], winwidth(0)+1) |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
120 let expect = [ |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
121 \ " aaa aa $ |", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
122 \ "$ |", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
123 \ "$ |", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
124 \ "~ |", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
125 \ ] |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
126 call assert_equal(expect, lines) |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
127 set list listchars+=precedes:< nowrap |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
128 call cursor(1, 1) |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
129 " move to end of line and scroll 2 characters back |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
130 norm! $2zh |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
131 let lines = ScreenLines([1,4], winwidth(0)+1) |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
132 let expect = [ |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
133 \ "<aaa aa $ |", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
134 \ "< |", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
135 \ "< |", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
136 \ "~ |", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
137 \ ] |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
138 call assert_equal(expect, lines) |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
139 set wrap |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
140 call cursor(1, 1) |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
141 " the complete line should be displayed in the window |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
142 norm! $ |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
143 |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
144 let lines = ScreenLines([1,10], winwidth(0)+1) |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
145 let expect = [ |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
146 \ "<aaa aaa a|", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
147 \ "a aaa aaa |", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
148 \ "aa aaa aaa|", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
149 \ " aa aaa aa|", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
150 \ "a aa aaa a|", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
151 \ "aa aa aaa |", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
152 \ "aaa aa aaa|", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
153 \ " aaa aa aa|", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
154 \ "a aaa aa a|", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
155 \ "aa aaa aa |", |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
156 \ ] |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
157 call assert_equal(expect, lines) |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
158 set list& listchars& wrap& |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
159 bw! |
851a014dfd8b
patch 8.1.2060: "precedes" in 'listchars' not used properly
Bram Moolenaar <Bram@vim.org>
parents:
17618
diff
changeset
|
160 endfunc |
18424
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
161 |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
162 " Check that win_lines() works correctly with the number_only parameter=TRUE |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
163 " should break early to optimize cost of drawing, but needs to make sure |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
164 " that the number column is correctly highlighted. |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
165 func Test_scroll_CursorLineNr_update() |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
166 CheckScreendump |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
167 |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
168 let lines =<< trim END |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
169 hi CursorLineNr ctermfg=73 ctermbg=236 |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
170 set nu rnu cursorline cursorlineopt=number |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
171 exe ":norm! o\<esc>110ia\<esc>" |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
172 END |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
173 let filename = 'Xdrawscreen' |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
174 call writefile(lines, filename) |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
175 let buf = RunVimInTerminal('-S '.filename, #{rows: 5, cols: 50}) |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
176 call term_sendkeys(buf, "k") |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
177 call term_wait(buf) |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
178 call VerifyScreenDump(buf, 'Test_winline_rnu', {}) |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
179 |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
180 " clean up |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
181 call StopVimInTerminal(buf) |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
182 call delete(filename) |
956a9bc4e25a
patch 8.1.2206: no test for fixed issue #3893
Bram Moolenaar <Bram@vim.org>
parents:
18131
diff
changeset
|
183 endfunc |
18866
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
184 |
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
185 " check a long file name does not result in the hit-enter prompt |
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
186 func Test_edit_long_file_name() |
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
187 CheckScreendump |
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
188 |
18890
623afba3566a
patch 8.2.0006: test using long file name may fail
Bram Moolenaar <Bram@vim.org>
parents:
18866
diff
changeset
|
189 let longName = 'x'->repeat(min([&columns, 255])) |
18866
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
190 call writefile([], longName) |
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
191 let buf = RunVimInTerminal('-N -u NONE ' .. longName, #{rows: 8}) |
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
192 |
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
193 call VerifyScreenDump(buf, 'Test_long_file_name_1', {}) |
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
194 |
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
195 call term_sendkeys(buf, ":q\<cr>") |
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
196 |
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
197 " clean up |
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
198 call StopVimInTerminal(buf) |
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
199 call delete(longName) |
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
200 endfunc |
a686560cf6c9
patch 8.1.2419: with a long file name the hit-enter prompt appears
Bram Moolenaar <Bram@vim.org>
parents:
18424
diff
changeset
|
201 |