annotate src/testdir/test_listchars.vim @ 27967:c91fca0baf52

Added tag v8.2.4508 for changeset 80f398bfc19f3e56f22a28a59f0d3c75849f7108
author Bram Moolenaar <Bram@vim.org>
date Sat, 05 Mar 2022 12:15:05 +0100
parents c75f70257cf5
children 9b292596a332
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12851
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests for 'listchars' display with 'list' and :list
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
25170
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
3 source check.vim
12851
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 source view_util.vim
25170
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
5 source screendump.vim
12851
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 func Test_listchars()
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 enew!
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 set ff=unix
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 set list
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 set listchars+=tab:>-,space:.,trail:<
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 call append(0, [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 \ ' aa ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 \ ' bb ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 \ ' cccc ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 \ 'dd ee ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 \ ' '
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 \ ])
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 let expected = [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 \ '>-------aa>-----$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 \ '..bb>---<<$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 \ '...cccc><$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 \ 'dd........ee<<>-$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 \ '<$'
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 \ ]
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 redraw!
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 for i in range(1, 5)
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 call cursor(i, 1)
18035
11dca9732a48 patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17742
diff changeset
30 call assert_equal([expected[i - 1]], ScreenLines(i, '$'->virtcol()))
12851
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 endfor
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 set listchars-=trail:<
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 let expected = [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 \ '>-------aa>-----$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 \ '..bb>---..$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 \ '...cccc>.$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 \ 'dd........ee..>-$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 \ '.$'
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 \ ]
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 redraw!
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 for i in range(1, 5)
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 call cursor(i, 1)
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 endfor
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46
15502
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
47 " tab with 3rd character.
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
48 set listchars-=tab:>-
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
49 set listchars+=tab:<=>,trail:-
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
50 let expected = [
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
51 \ '<======>aa<====>$',
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
52 \ '..bb<==>--$',
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
53 \ '...cccc>-$',
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
54 \ 'dd........ee--<>$',
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
55 \ '-$'
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
56 \ ]
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
57 redraw!
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
58 for i in range(1, 5)
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
59 call cursor(i, 1)
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
60 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
61 endfor
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
62
17742
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
63 " tab with 3rd character and linebreak set
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
64 set listchars-=tab:<=>
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
65 set listchars+=tab:<·>
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
66 set linebreak
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
67 let expected = [
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
68 \ '<······>aa<····>$',
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
69 \ '..bb<··>--$',
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
70 \ '...cccc>-$',
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
71 \ 'dd........ee--<>$',
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
72 \ '-$'
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
73 \ ]
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
74 redraw!
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
75 for i in range(1, 5)
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
76 call cursor(i, 1)
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
77 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
78 endfor
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
79 set nolinebreak
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
80 set listchars-=tab:<·>
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
81 set listchars+=tab:<=>
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
82
15502
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
83 set listchars-=trail:-
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
84 let expected = [
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
85 \ '<======>aa<====>$',
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
86 \ '..bb<==>..$',
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
87 \ '...cccc>.$',
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
88 \ 'dd........ee..<>$',
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
89 \ '.$'
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
90 \ ]
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
91 redraw!
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
92 for i in range(1, 5)
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
93 call cursor(i, 1)
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
94 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
95 endfor
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
96
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
97 set listchars-=tab:<=>
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
98 set listchars+=tab:>-
12851
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
99 set listchars+=trail:<
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100 set nolist
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101 normal ggdG
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
102 call append(0, [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
103 \ ' fff ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
104 \ ' gg ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
105 \ ' h ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
106 \ 'iii ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
107 \ ])
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
108 let l = split(execute("%list"), "\n")
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
109 call assert_equal([
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
110 \ '..fff>--<<$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
111 \ '>-------gg>-----$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
112 \ '.....h>-$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
113 \ 'iii<<<<><<$', '$'], l)
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
114
23825
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
115 " Test lead and trail
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
116 normal ggdG
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
117 set listchars&
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
118 set listchars+=lead:>,trail:<,space:x
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
119 set list
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
120
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
121 call append(0, [
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
122 \ ' ffff ',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
123 \ ' gg',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
124 \ 'h ',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
125 \ ' ',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
126 \ ' 0 0 ',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
127 \ ])
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
128
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
129 let expected = [
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
130 \ '>>>>ffff<<<<$',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
131 \ '>>>>>>>>>>gg$',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
132 \ 'h<<<<<<<<<<<$',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
133 \ '<<<<<<<<<<<<$',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
134 \ '>>>>0xx0<<<<$',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
135 \ '$'
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
136 \ ]
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
137 redraw!
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
138 for i in range(1, 5)
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
139 call cursor(i, 1)
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
140 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
141 endfor
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
142
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
143 call assert_equal(expected, split(execute("%list"), "\n"))
15715
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
144
25778
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
145 " Test multispace
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
146 normal ggdG
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
147 set listchars&
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
148 set listchars+=multispace:yYzZ
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
149 set list
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
150
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
151 call append(0, [
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
152 \ ' ffff ',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
153 \ ' i i gg',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
154 \ ' h ',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
155 \ ' j ',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
156 \ ' 0 0 ',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
157 \ ])
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
158
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
159 let expected = [
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
160 \ 'yYzZffffyYzZ$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
161 \ 'yYi iyYzZygg$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
162 \ ' hyYzZyYzZyY$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
163 \ 'yYzZyYzZyYj $',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
164 \ 'yYzZ0yY0yYzZ$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
165 \ '$'
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
166 \ ]
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
167 redraw!
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
168 for i in range(1, 5)
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
169 call cursor(i, 1)
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
170 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
171 endfor
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
172
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
173 call assert_equal(expected, split(execute("%list"), "\n"))
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
174
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
175 " the last occurrence of 'multispace:' is used
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
176 set listchars+=space:x,multispace:XyY
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
177
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
178 let expected = [
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
179 \ 'XyYXffffXyYX$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
180 \ 'XyixiXyYXygg$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
181 \ 'xhXyYXyYXyYX$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
182 \ 'XyYXyYXyYXjx$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
183 \ 'XyYX0Xy0XyYX$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
184 \ '$'
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
185 \ ]
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
186 redraw!
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
187 for i in range(1, 5)
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
188 call cursor(i, 1)
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
189 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
190 endfor
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
191
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
192 call assert_equal(expected, split(execute("%list"), "\n"))
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
193
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
194 set listchars+=lead:>,trail:<
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
195
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
196 let expected = [
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
197 \ '>>>>ffff<<<<$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
198 \ '>>ixiXyYXygg$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
199 \ '>h<<<<<<<<<<$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
200 \ '>>>>>>>>>>j<$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
201 \ '>>>>0Xy0<<<<$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
202 \ '$'
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
203 \ ]
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
204 redraw!
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
205 for i in range(1, 5)
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
206 call cursor(i, 1)
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
207 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
208 endfor
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
209
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
210 call assert_equal(expected, split(execute("%list"), "\n"))
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
211
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
212 " removing 'multispace:'
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
213 set listchars-=multispace:XyY
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
214 set listchars-=multispace:yYzZ
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
215
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
216 let expected = [
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
217 \ '>>>>ffff<<<<$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
218 \ '>>ixixxxxxgg$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
219 \ '>h<<<<<<<<<<$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
220 \ '>>>>>>>>>>j<$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
221 \ '>>>>0xx0<<<<$',
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
222 \ '$'
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
223 \ ]
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
224 redraw!
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
225 for i in range(1, 5)
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
226 call cursor(i, 1)
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
227 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
228 endfor
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
229
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
230 call assert_equal(expected, split(execute("%list"), "\n"))
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
231
15715
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
232 " test nbsp
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
233 normal ggdG
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
234 set listchars=nbsp:X,trail:Y
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
235 set list
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
236 " Non-breaking space
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
237 let nbsp = nr2char(0xa0)
24198
c784e176334c patch 8.2.2640: screenstring() returns non-existing composing characters
Bram Moolenaar <Bram@vim.org>
parents: 23956
diff changeset
238 call append(0, [ ">" .. nbsp .. "<" ])
15715
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
239
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
240 let expected = '>X< '
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
241
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
242 redraw!
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
243 call cursor(1, 1)
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
244 call assert_equal([expected], ScreenLines(1, virtcol('$')))
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
245
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
246 set listchars=nbsp:X
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
247 redraw!
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
248 call cursor(1, 1)
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
249 call assert_equal([expected], ScreenLines(1, virtcol('$')))
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
250
16592
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
251 " test extends
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
252 normal ggdG
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
253 set listchars=extends:Z
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
254 set nowrap
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
255 set nolist
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
256 call append(0, [ repeat('A', &columns + 1) ])
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
257
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
258 let expected = repeat('A', &columns)
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
259
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
260 redraw!
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
261 call cursor(1, 1)
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
262 call assert_equal([expected], ScreenLines(1, &columns))
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
263
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
264 set list
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
265 let expected = expected[:-2] . 'Z'
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
266 redraw!
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
267 call cursor(1, 1)
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
268 call assert_equal([expected], ScreenLines(1, &columns))
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
269
12851
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
270 enew!
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
271 set listchars& ff&
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
272 endfunc
16146
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
273
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
274 " Test that unicode listchars characters get properly inserted
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
275 func Test_listchars_unicode()
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
276 enew!
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
277 let oldencoding=&encoding
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
278 set encoding=utf-8
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
279 set ff=unix
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
280
25778
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
281 set listchars=eol:⇔,space:␣,multispace:≡≢≣,nbsp:≠,tab:←↔→
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
282 set list
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
283
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
284 let nbsp = nr2char(0xa0)
25778
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
285 call append(0, [" a\tb c" .. nbsp .. "d "])
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
286 let expected = ['≡≢≣≡≢≣≡≢a←↔↔↔↔↔→b␣c≠d≡≢⇔']
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
287 redraw!
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
288 call cursor(1, 1)
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
289 call assert_equal(expected, ScreenLines(1, virtcol('$')))
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
290
25978
40b17deb294f patch 8.2.3522: cannot use x and u when setting 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 25778
diff changeset
291 set listchars=eol:\\u21d4,space:\\u2423,multispace:≡\\u2262\\U00002263,nbsp:\\U00002260,tab:←↔\\u2192
40b17deb294f patch 8.2.3522: cannot use x and u when setting 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 25778
diff changeset
292 redraw!
40b17deb294f patch 8.2.3522: cannot use x and u when setting 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 25778
diff changeset
293 call assert_equal(expected, ScreenLines(1, virtcol('$')))
40b17deb294f patch 8.2.3522: cannot use x and u when setting 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 25778
diff changeset
294
25778
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
295 set listchars+=lead:⇨,trail:⇦
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
296 let expected = ['⇨⇨⇨⇨⇨⇨⇨⇨a←↔↔↔↔↔→b␣c≠d⇦⇦⇔']
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
297 redraw!
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
298 call cursor(1, 1)
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
299 call assert_equal(expected, ScreenLines(1, virtcol('$')))
25778
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
300
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
301 let &encoding=oldencoding
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
302 enew!
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
303 set listchars& ff&
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
304 endfunction
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
305
25778
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
306 func Test_listchars_invalid()
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
307 enew!
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
308 set ff=unix
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
309
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
310 set listchars&
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
311 set list
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
312 set ambiwidth=double
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
313
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
314 " No colon
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
315 call assert_fails('set listchars=x', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
316 call assert_fails('set listchars=x', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
317 call assert_fails('set listchars=multispace', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
318
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
319 " Too short
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
320 call assert_fails('set listchars=space:', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
321 call assert_fails('set listchars=tab:x', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
322 call assert_fails('set listchars=multispace:', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
323
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
324 " One occurrence too short
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
325 call assert_fails('set listchars=space:,space:x', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
326 call assert_fails('set listchars=space:x,space:', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
327 call assert_fails('set listchars=tab:x,tab:xx', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
328 call assert_fails('set listchars=tab:xx,tab:x', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
329 call assert_fails('set listchars=multispace:,multispace:x', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
330 call assert_fails('set listchars=multispace:x,multispace:', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
331
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
332 " Too long
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
333 call assert_fails('set listchars=space:xx', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
334 call assert_fails('set listchars=tab:xxxx', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
335
26634
c75f70257cf5 patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents: 26077
diff changeset
336 " Has double-width character
25778
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
337 call assert_fails('set listchars=space:·', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
338 call assert_fails('set listchars=tab:·x', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
339 call assert_fails('set listchars=tab:x·', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
340 call assert_fails('set listchars=tab:xx·', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
341 call assert_fails('set listchars=multispace:·', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
342 call assert_fails('set listchars=multispace:xxx·', 'E474:')
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
343
26634
c75f70257cf5 patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents: 26077
diff changeset
344 " Has control character
c75f70257cf5 patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents: 26077
diff changeset
345 call assert_fails("set listchars=space:\x01", 'E474:')
c75f70257cf5 patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents: 26077
diff changeset
346 call assert_fails("set listchars=tab:\x01x", 'E474:')
c75f70257cf5 patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents: 26077
diff changeset
347 call assert_fails("set listchars=tab:x\x01", 'E474:')
c75f70257cf5 patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents: 26077
diff changeset
348 call assert_fails("set listchars=tab:xx\x01", 'E474:')
c75f70257cf5 patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents: 26077
diff changeset
349 call assert_fails("set listchars=multispace:\x01", 'E474:')
c75f70257cf5 patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents: 26077
diff changeset
350 call assert_fails("set listchars=multispace:xxx\x01", 'E474:')
c75f70257cf5 patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents: 26077
diff changeset
351 call assert_fails('set listchars=space:\\x01', 'E474:')
c75f70257cf5 patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents: 26077
diff changeset
352 call assert_fails('set listchars=tab:\\x01x', 'E474:')
c75f70257cf5 patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents: 26077
diff changeset
353 call assert_fails('set listchars=tab:x\\x01', 'E474:')
c75f70257cf5 patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents: 26077
diff changeset
354 call assert_fails('set listchars=tab:xx\\x01', 'E474:')
c75f70257cf5 patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents: 26077
diff changeset
355 call assert_fails('set listchars=multispace:\\x01', 'E474:')
c75f70257cf5 patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents: 26077
diff changeset
356 call assert_fails('set listchars=multispace:xxx\\x01', 'E474:')
c75f70257cf5 patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents: 26077
diff changeset
357
25778
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
358 enew!
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
359 set ambiwidth& listchars& ff&
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
360 endfunction
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
361
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
362 " Tests that space characters following composing character won't get replaced
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
363 " by listchars.
16146
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
364 func Test_listchars_composing()
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
365 enew!
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
366 let oldencoding=&encoding
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
367 set encoding=utf-8
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
368 set ff=unix
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
369 set list
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
370
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
371 set listchars=eol:$,space:_,nbsp:=
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
372
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
373 let nbsp1 = nr2char(0xa0)
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
374 let nbsp2 = nr2char(0x202f)
16146
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
375 call append(0, [
24198
c784e176334c patch 8.2.2640: screenstring() returns non-existing composing characters
Bram Moolenaar <Bram@vim.org>
parents: 23956
diff changeset
376 \ " \u3099\t \u309A" .. nbsp1 .. nbsp1 .. "\u0302" .. nbsp2 .. nbsp2 .. "\u0302",
16146
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
377 \ ])
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
378 let expected = [
24198
c784e176334c patch 8.2.2640: screenstring() returns non-existing composing characters
Bram Moolenaar <Bram@vim.org>
parents: 23956
diff changeset
379 \ "_ \u3099^I \u309A=" .. nbsp1 .. "\u0302=" .. nbsp2 .. "\u0302$"
16146
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
380 \ ]
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
381 redraw!
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
382 call cursor(1, 1)
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
383 call assert_equal(expected, ScreenLines(1, virtcol('$')))
16146
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
384 let &encoding=oldencoding
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
385 enew!
16146
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
386 set listchars& ff&
aaa6e9a43a60 patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents: 15715
diff changeset
387 endfunction
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 18035
diff changeset
388
23952
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
389 " Check for the value of the 'listchars' option
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
390 func s:CheckListCharsValue(expected)
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
391 call assert_equal(a:expected, &listchars)
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
392 call assert_equal(a:expected, getwinvar(0, '&listchars'))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
393 endfunc
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
394
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
395 " Test for using a window local value for 'listchars'
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
396 func Test_listchars_window_local()
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
397 %bw!
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
398 set list listchars&
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
399 new
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
400 " set a local value for 'listchars'
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
401 setlocal listchars=tab:+-,eol:#
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
402 call s:CheckListCharsValue('tab:+-,eol:#')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
403 " When local value is reset, global value should be used
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
404 setlocal listchars=
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
405 call s:CheckListCharsValue('eol:$')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
406 " Use 'setlocal <' to copy global value
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
407 setlocal listchars=space:.,extends:>
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
408 setlocal listchars<
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
409 call s:CheckListCharsValue('eol:$')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
410 " Use 'set <' to copy global value
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
411 setlocal listchars=space:.,extends:>
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
412 set listchars<
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
413 call s:CheckListCharsValue('eol:$')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
414 " Changing global setting should not change the local setting
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
415 setlocal listchars=space:.,extends:>
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
416 setglobal listchars=tab:+-,eol:#
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
417 call s:CheckListCharsValue('space:.,extends:>')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
418 " when split opening a new window, local value should be copied
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
419 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
420 call s:CheckListCharsValue('space:.,extends:>')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
421 " clearing local value in one window should not change the other window
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
422 set listchars&
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
423 call s:CheckListCharsValue('eol:$')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
424 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
425 call s:CheckListCharsValue('space:.,extends:>')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
426
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
427 " use different values for 'listchars' items in two different windows
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
428 call setline(1, ["\t one two "])
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
429 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
430 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
431 setlocal listchars=tab:[.],lead:#,space:_,trail:.,eol:&
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
432 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
433 set listchars=tab:+-+,lead:^,space:>,trail:<,eol:%
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
434 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
435 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
436 call assert_equal(['[......]##one__two..&'], ScreenLines(1, virtcol('$')))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
437 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
438 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
439 " changing the global setting should not change the local value
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
440 setglobal listchars=tab:[.],lead:#,space:_,trail:.,eol:&
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
441 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
442 set listchars<
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
443 call assert_equal(['[......]##one__two..&'], ScreenLines(1, virtcol('$')))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
444
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
445 " Using setglobal in a window with local setting should not affect the
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
446 " window. But should impact other windows using the global setting.
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
447 enew! | only
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
448 call setline(1, ["\t one two "])
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
449 set listchars=tab:[.],lead:#,space:_,trail:.,eol:&
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
450 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
451 setlocal listchars=tab:+-+,lead:^,space:>,trail:<,eol:%
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
452 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
453 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
454 setglobal listchars=tab:{.},lead:-,space:=,trail:#,eol:$
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
455 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
456 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
457 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
458 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
459 call assert_equal(['{......}--one==two##$'], ScreenLines(1, virtcol('$')))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
460
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
461 " Setting the global setting to the default value should not impact a window
26077
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
462 " using a local setting.
23952
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
463 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
464 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
465 setglobal listchars&vim
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
466 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
467 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
468 call assert_equal(['^I one two $'], ScreenLines(1, virtcol('$')))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
469
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
470 " Setting the local setting to the default value should not impact a window
26077
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
471 " using a global setting.
23952
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
472 set listchars=tab:{.},lead:-,space:=,trail:#,eol:$
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
473 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
474 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
475 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
476 setlocal listchars&vim
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
477 call assert_equal(['^I one two $'], ScreenLines(1, virtcol('$')))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
478 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
479 call assert_equal(['{......}--one==two##$'], ScreenLines(1, virtcol('$')))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
480
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
481 " Using set in a window with a local setting should change it to use the
26077
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
482 " global setting and also impact other windows using the global setting.
23952
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
483 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
484 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
485 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
486 set listchars=tab:+-+,lead:^,space:>,trail:<,eol:%
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
487 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
488 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
489 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
490
23956
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
491 " Setting invalid value for a local setting should not impact the local and
26077
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
492 " global settings.
23956
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
493 split
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
494 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
495 let cmd = 'setlocal listchars=tab:{.},lead:-,space:=,trail:#,eol:$,x'
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
496 call assert_fails(cmd, 'E474:')
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
497 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
498 close
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
499 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
500
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
501 " Setting invalid value for a global setting should not impact the local and
26077
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
502 " global settings.
23956
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
503 split
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
504 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
505 let cmd = 'setglobal listchars=tab:{.},lead:-,space:=,trail:#,eol:$,x'
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
506 call assert_fails(cmd, 'E474:')
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
507 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
508 close
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
509 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
510
26077
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
511 " Closing window with local lcs-multispace should not cause a memory leak.
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
512 setlocal listchars=multispace:---+
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
513 split
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
514 call s:CheckListCharsValue('multispace:---+')
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
515 close
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
516
23952
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
517 %bw!
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
518 set list& listchars&
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
519 endfunc
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
520
25170
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
521 func Test_listchars_foldcolumn()
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
522 CheckScreendump
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
523
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
524 let lines =<< trim END
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
525 call setline(1, ['aaa', '', 'a', 'aaaaaa'])
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
526 vsplit
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
527 vsplit
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
528 windo set signcolumn=yes foldcolumn=1 winminwidth=0 nowrap list listchars=extends:>,precedes:<
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
529 END
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
530 call writefile(lines, 'XTest_listchars')
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
531
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
532 let buf = RunVimInTerminal('-S XTest_listchars', {'rows': 10, 'cols': 60})
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
533
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
534 call term_sendkeys(buf, "13\<C-W>>")
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
535 call VerifyScreenDump(buf, 'Test_listchars_01', {})
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
536 call term_sendkeys(buf, "\<C-W>>")
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
537 call VerifyScreenDump(buf, 'Test_listchars_02', {})
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
538 call term_sendkeys(buf, "\<C-W>>")
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
539 call VerifyScreenDump(buf, 'Test_listchars_03', {})
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
540 call term_sendkeys(buf, "\<C-W>>")
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
541 call VerifyScreenDump(buf, 'Test_listchars_04', {})
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
542 call term_sendkeys(buf, "\<C-W>>")
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
543 call VerifyScreenDump(buf, 'Test_listchars_05', {})
25172
406ab8d0bc0f patch 8.2.3122: with 'nowrap' cursor position is unexected in narrow window
Bram Moolenaar <Bram@vim.org>
parents: 25170
diff changeset
544 call term_sendkeys(buf, "\<C-W>h")
406ab8d0bc0f patch 8.2.3122: with 'nowrap' cursor position is unexected in narrow window
Bram Moolenaar <Bram@vim.org>
parents: 25170
diff changeset
545 call term_sendkeys(buf, ":set nowrap foldcolumn=4\<CR>")
406ab8d0bc0f patch 8.2.3122: with 'nowrap' cursor position is unexected in narrow window
Bram Moolenaar <Bram@vim.org>
parents: 25170
diff changeset
546 call term_sendkeys(buf, "15\<C-W><")
406ab8d0bc0f patch 8.2.3122: with 'nowrap' cursor position is unexected in narrow window
Bram Moolenaar <Bram@vim.org>
parents: 25170
diff changeset
547 call VerifyScreenDump(buf, 'Test_listchars_06', {})
406ab8d0bc0f patch 8.2.3122: with 'nowrap' cursor position is unexected in narrow window
Bram Moolenaar <Bram@vim.org>
parents: 25170
diff changeset
548 call term_sendkeys(buf, "4\<C-W><")
406ab8d0bc0f patch 8.2.3122: with 'nowrap' cursor position is unexected in narrow window
Bram Moolenaar <Bram@vim.org>
parents: 25170
diff changeset
549 call VerifyScreenDump(buf, 'Test_listchars_07', {})
25170
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
550
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
551 " clean up
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
552 call StopVimInTerminal(buf)
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
553 call delete('XTest_listchars')
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
554 endfunc
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
555
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
556
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 18035
diff changeset
557 " vim: shiftwidth=2 sts=2 expandtab