blob: 9e43f703e99f3cc03b700321219f554589ecf6ba [file] [log] [blame]
Bram Moolenaar9750bb12012-12-05 16:10:42 +01001vim: set ft=vim
2
3Tests for correct display (cursor column position) with +conceal and
4tabulators.
5
6STARTTEST
7:so small.vim
8:if !has('conceal')
9 e! test.ok
10 wq! test.out
11:endif
12:" Conceal settings.
13:set conceallevel=2
14:set concealcursor=nc
15:syntax match test /|/ conceal
16:" Save current cursor position. Only works in <expr> mode, can't be used
17:" with :normal because it moves the cursor to the command line. Thanks to ZyX
18:" <zyx.vim@gmail.com> for the idea to use an <expr> mapping.
19:let positions = []
20:nnoremap <expr> GG ":let positions += ['".screenrow().":".screencol()."']\n"
21:" Start test.
22/^start:
23:normal ztj
24GGk
25:" We should end up in the same column when running these commands on the two
26:" lines.
27:normal ft
28GGk
29:normal $
30GGk
31:normal 0j
32GGk
33:normal ft
34GGk
35:normal $
36GGk
37:normal 0j0j
38GGk
39:" Same for next test block.
40:normal ft
41GGk
42:normal $
43GGk
44:normal 0j
45GGk
46:normal ft
47GGk
48:normal $
49GGk
50:normal 0j0j
51GGk
52:" And check W with multiple tabs and conceals in a line.
53:normal W
54GGk
55:normal W
56GGk
57:normal W
58GGk
59:normal $
60GGk
61:normal 0j
62GGk
63:normal W
64GGk
65:normal W
66GGk
67:normal W
68GGk
69:normal $
70GGk
Bram Moolenaar3ff9b182013-07-13 12:36:55 +020071:set lbr
72:normal $
73GGk
Bram Moolenaar8fc6bc72015-02-17 17:26:10 +010074:set list listchars=tab:>-
75:normal 0
76GGk
77:normal W
78GGk
79:normal W
80GGk
81:normal W
82GGk
83:normal $
84GGk
Bram Moolenaar9750bb12012-12-05 16:10:42 +010085:" Display result.
86:call append('$', 'end:')
87:call append('$', positions)
88:/^end/,$wq! test.out
89ENDTEST
90
91start:
92.concealed. text
93|concealed| text
94
95 .concealed. text
96 |concealed| text
97
98.a. .b. .c. .d.
99|a| |b| |c| |d|