blob: 1536b3bba7590c51b72340039ee3be7cffdda067 [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
71:" Display result.
72:call append('$', 'end:')
73:call append('$', positions)
74:/^end/,$wq! test.out
75ENDTEST
76
77start:
78.concealed. text
79|concealed| text
80
81 .concealed. text
82 |concealed| text
83
84.a. .b. .c. .d.
85|a| |b| |c| |d|