annotate src/testdir/test_listchars.vim @ 33730:1a0886e98382 v9.0.2094

patch 9.0.2094: Vim9: need more assignment tests Commit: https://github.com/vim/vim/commit/1fc47c2c9bf3121268ebab03a0662e0cf2e5cb26 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Wed Nov 8 21:02:48 2023 +0100 patch 9.0.2094: Vim9: need more assignment tests Problem: Vim9: need more assignment tests Solution: Add test for using different types in assignment, function arguments and return values closes: #13491 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 08 Nov 2023 21:15:04 +0100
parents e385bda5e345
children 6c92d6f3a255
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
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
7 func Check_listchars(expected, end_lnum, end_scol = -1, leftcol = 0)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
8 if a:leftcol > 0
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
9 let save_wrap = &wrap
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
10 set nowrap
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
11 call cursor(1, 1)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
12 exe 'normal! ' .. a:leftcol .. 'zl'
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
13 endif
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
14
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
15 redraw!
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
16 for i in range(1, a:end_lnum)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
17 if a:leftcol > 0
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
18 let col = virtcol2col(0, i, a:leftcol)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
19 let col += getline(i)->strpart(col - 1, 1, v:true)->len()
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
20 call cursor(i, col)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
21 redraw
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
22 call assert_equal(a:leftcol, winsaveview().leftcol)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
23 else
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
24 call cursor(i, 1)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
25 end
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
26
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
27 let end_scol = a:end_scol < 0 ? '$'->virtcol() - a:leftcol : a:end_scol
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
28 call assert_equal([a:expected[i - 1]->strcharpart(a:leftcol)],
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
29 \ ScreenLines(i, end_scol))
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
30 endfor
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
31
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
32 if a:leftcol > 0
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
33 let &wrap = save_wrap
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
34 endif
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
35 endfunc
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
36
12851
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 func Test_listchars()
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 enew!
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 set ff=unix
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 set list
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 set listchars+=tab:>-,space:.,trail:<
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 call append(0, [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 \ ' aa ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 \ ' bb ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 \ ' cccc ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 \ 'dd ee ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 \ ' '
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 \ ])
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 let expected = [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 \ '>-------aa>-----$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 \ '..bb>---<<$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 \ '...cccc><$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 \ 'dd........ee<<>-$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 \ '<$'
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 \ ]
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
57 call Check_listchars(expected, 5)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
58 call Check_listchars(expected, 4, -1, 5)
12851
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 set listchars-=trail:<
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 let expected = [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 \ '>-------aa>-----$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 \ '..bb>---..$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 \ '...cccc>.$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 \ 'dd........ee..>-$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66 \ '.$'
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
67 \ ]
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
68 call Check_listchars(expected, 5)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
69 call Check_listchars(expected, 4, -1, 5)
12851
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70
15502
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
71 " 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
72 set listchars-=tab:>-
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
73 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
74 let expected = [
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
75 \ '<======>aa<====>$',
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
76 \ '..bb<==>--$',
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
77 \ '...cccc>-$',
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
78 \ 'dd........ee--<>$',
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
79 \ '-$'
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
80 \ ]
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
81 call Check_listchars(expected, 5)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
82 call Check_listchars(expected, 4, -1, 5)
15502
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
83
17742
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
84 " 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
85 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
86 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
87 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
88 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
89 \ '<······>aa<····>$',
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
90 \ '..bb<··>--$',
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
91 \ '...cccc>-$',
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
92 \ '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
93 \ '-$'
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
94 \ ]
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
95 call Check_listchars(expected, 5)
17742
a51ccadd0dca patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 16592
diff changeset
96 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
97 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
98 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
99
15502
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
100 set listchars-=trail:-
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
101 let expected = [
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
102 \ '<======>aa<====>$',
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
103 \ '..bb<==>..$',
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
104 \ '...cccc>.$',
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
105 \ 'dd........ee..<>$',
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
106 \ '.$'
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
107 \ ]
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
108 call Check_listchars(expected, 5)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
109 call Check_listchars(expected, 4, -1, 5)
15502
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
110
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
111 set listchars-=tab:<=>
bc17a9d37810 patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents: 12851
diff changeset
112 set listchars+=tab:>-
12851
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
113 set listchars+=trail:<
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
114 set nolist
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
115 normal ggdG
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
116 call append(0, [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
117 \ ' fff ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
118 \ ' gg ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
119 \ ' h ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
120 \ 'iii ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
121 \ ])
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
122 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
123 call assert_equal([
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
124 \ '..fff>--<<$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
125 \ '>-------gg>-----$',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
126 \ '.....h>-$',
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
127 \ 'iii<<<<><<$',
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
128 \ '$'], l)
12851
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
129
23825
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
130 " 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
131 normal ggdG
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
132 set listchars&
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
133 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
134 set list
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 call append(0, [
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
137 \ ' ffff ',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
138 \ ' gg',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
139 \ 'h ',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
140 \ ' ',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
141 \ ' 0 0 ',
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
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
144 let expected = [
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
145 \ '>>>>ffff<<<<$',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
146 \ '>>>>>>>>>>gg$',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
147 \ 'h<<<<<<<<<<<$',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
148 \ '<<<<<<<<<<<<$',
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
149 \ '>>>>0xx0<<<<$',
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
150 \ '$'
23825
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
151 \ ]
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
152 call Check_listchars(expected, 6)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
153 call Check_listchars(expected, 5, -1, 6)
23825
0bd44e94dd14 patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
154 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
155
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
156 " 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
157 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
158 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
159 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
160 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
161
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 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
163 \ ' 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
164 \ ' 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
165 \ ' 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
166 \ ' 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
167 \ ' 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
168 \ ])
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
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 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
171 \ '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
172 \ '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
173 \ ' 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
174 \ '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
175 \ 'yYzZ0yY0yYzZ$',
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
176 \ '$'
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
177 \ ]
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
178 call Check_listchars(expected, 6)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
179 call Check_listchars(expected, 5, -1, 6)
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
180 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
181
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
182 " Test leadmultispace + multispace
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
183 normal ggdG
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
184 set listchars=eol:$,multispace:yYzZ,nbsp:S
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
185 set listchars+=leadmultispace:.-+*
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
186 set list
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
187
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
188 call append(0, [
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
189 \ ' ffff ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
190 \ ' i i  gg',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
191 \ ' h ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
192 \ ' j ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
193 \ ' 0 0 ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
194 \ ])
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
195
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
196 let expected = [
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
197 \ '.-+*ffffyYzZ$',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
198 \ '.-i iSyYzZgg$',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
199 \ ' hyYzZyYzZyY$',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
200 \ '.-+*.-+*.-j $',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
201 \ '.-+*0yY0yYzZ$',
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
202 \ '$'
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
203 \ ]
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
204 call assert_equal('eol:$,multispace:yYzZ,nbsp:S,leadmultispace:.-+*', &listchars)
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
205 call Check_listchars(expected, 6)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
206 call Check_listchars(expected, 5, -1, 1)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
207 call Check_listchars(expected, 5, -1, 2)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
208 call Check_listchars(expected, 5, -1, 3)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
209 call Check_listchars(expected, 5, -1, 6)
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
210 call assert_equal(expected, split(execute("%list"), "\n"))
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
211
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
212 " Test leadmultispace without multispace
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
213 normal ggdG
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
214 set listchars-=multispace:yYzZ
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
215 set listchars+=space:+,trail:>,eol:$
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
216 set list
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
217
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
218 call append(0, [
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
219 \ ' ffff ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
220 \ ' i i gg',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
221 \ ' h ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
222 \ ' j ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
223 \ ' 0 0 ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
224 \ ])
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
225
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
226 let expected = [
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
227 \ '.-+*ffff>>>>$',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
228 \ '.-i+i+++++gg$',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
229 \ '+h>>>>>>>>>>$',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
230 \ '.-+*.-+*.-j>$',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
231 \ '.-+*0++0>>>>$',
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
232 \ '$'
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
233 \ ]
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
234 call assert_equal('eol:$,nbsp:S,leadmultispace:.-+*,space:+,trail:>,eol:$', &listchars)
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
235 call Check_listchars(expected, 6)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
236 call Check_listchars(expected, 5, -1, 1)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
237 call Check_listchars(expected, 5, -1, 2)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
238 call Check_listchars(expected, 5, -1, 3)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
239 call Check_listchars(expected, 5, -1, 6)
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
240 call assert_equal(expected, split(execute("%list"), "\n"))
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
241
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
242 " Test leadmultispace only
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
243 normal ggdG
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
244 set listchars&
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
245 set listchars=leadmultispace:.-+*
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
246 set list
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
247
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
248 call append(0, [
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
249 \ ' ffff ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
250 \ ' i i gg',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
251 \ ' h ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
252 \ ' j ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
253 \ ' 0 0 ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
254 \ ])
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
255
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
256 let expected = [
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
257 \ '.-+*ffff ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
258 \ '.-i i gg',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
259 \ ' h ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
260 \ '.-+*.-+*.-j ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
261 \ '.-+*0 0 ',
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
262 \ ' '
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
263 \ ]
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
264 call assert_equal('leadmultispace:.-+*', &listchars)
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
265 call Check_listchars(expected, 5, 12)
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
266 call assert_equal(expected, split(execute("%list"), "\n"))
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
267
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
268 " Test leadmultispace and lead and space
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
269 normal ggdG
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
270 set listchars&
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
271 set listchars+=lead:<,space:-
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
272 set listchars+=leadmultispace:.-+*
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
273 set list
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
274
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
275 call append(0, [
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
276 \ ' ffff ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
277 \ ' i i gg',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
278 \ ' h ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
279 \ ' j ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
280 \ ' 0 0 ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
281 \ ])
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
282
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
283 let expected = [
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
284 \ '.-+*ffff----$',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
285 \ '.-i-i-----gg$',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
286 \ '<h----------$',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
287 \ '.-+*.-+*.-j-$',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
288 \ '.-+*0--0----$',
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
289 \ '$'
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
290 \ ]
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
291 call assert_equal('eol:$,lead:<,space:-,leadmultispace:.-+*', &listchars)
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
292 call Check_listchars(expected, 6)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
293 call Check_listchars(expected, 5, -1, 1)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
294 call Check_listchars(expected, 5, -1, 2)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
295 call Check_listchars(expected, 5, -1, 3)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
296 call Check_listchars(expected, 5, -1, 6)
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
297 call assert_equal(expected, split(execute("%list"), "\n"))
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
298
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
299 " the last occurrence of 'multispace:' is used
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
300 set listchars&
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
301 set listchars+=multispace:yYzZ
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
302 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
303
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
304 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
305 \ '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
306 \ '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
307 \ '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
308 \ '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
309 \ 'XyYX0Xy0XyYX$',
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
310 \ '$'
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
311 \ ]
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
312 call assert_equal('eol:$,multispace:yYzZ,space:x,multispace:XyY', &listchars)
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
313 call Check_listchars(expected, 6)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
314 call Check_listchars(expected, 5, -1, 6)
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
315 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
316
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 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
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 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
320 \ '>>>>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
321 \ '>>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
322 \ '>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
323 \ '>>>>>>>>>>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
324 \ '>>>>0Xy0<<<<$',
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
325 \ '$'
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
326 \ ]
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
327 call Check_listchars(expected, 6)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
328 call Check_listchars(expected, 5, -1, 6)
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
329 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
330
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 " 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
332 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
333 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
334
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 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
336 \ '>>>>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
337 \ '>>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
338 \ '>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
339 \ '>>>>>>>>>>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
340 \ '>>>>0xx0<<<<$',
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
341 \ '$'
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
342 \ ]
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
343 call Check_listchars(expected, 6)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
344 call Check_listchars(expected, 5, -1, 6)
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
345 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
346
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
347 " 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
348 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
349 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
350 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
351 " 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
352 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
353 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
354
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
355 let expected = '>X< '
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
356 call Check_listchars([expected], 1)
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
357
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
358 set listchars=nbsp:X
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
359 call Check_listchars([expected], 1)
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
360
16592
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
361 " 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
362 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
363 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
364 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
365 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
366 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
367
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
368 let expected = repeat('A', &columns)
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
369 call Check_listchars([expected], 1, &columns)
16592
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
370
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
371 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
372 let expected = expected[:-2] . 'Z'
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
373 call Check_listchars([expected], 1, &columns)
16592
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
374
12851
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
375 enew!
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
376 set listchars& ff&
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
377 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
378
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
379 " 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
380 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
381 enew!
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
382 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
383 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
384 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
385
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
386 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
387 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
388
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
389 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
390 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
391 let expected = ['≡≢≣≡≢≣≡≢a←↔↔↔↔↔→b␣c≠d≡≢⇔']
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
392 call Check_listchars(expected, 1)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
393 call Check_listchars(expected, 1, -1, 3)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
394 call Check_listchars(expected, 1, -1, 13)
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
395
25978
40b17deb294f patch 8.2.3522: cannot use x and u when setting 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 25778
diff changeset
396 set listchars=eol:\\u21d4,space:\\u2423,multispace:≡\\u2262\\U00002263,nbsp:\\U00002260,tab:←↔\\u2192
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
397 call Check_listchars(expected, 1)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
398 call Check_listchars(expected, 1, -1, 3)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
399 call Check_listchars(expected, 1, -1, 13)
25978
40b17deb294f patch 8.2.3522: cannot use x and u when setting 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 25778
diff changeset
400
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
401 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
402 let expected = ['⇨⇨⇨⇨⇨⇨⇨⇨a←↔↔↔↔↔→b␣c≠d⇦⇦⇔']
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
403 call Check_listchars(expected, 1)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
404 call Check_listchars(expected, 1, -1, 3)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
405 call Check_listchars(expected, 1, -1, 13)
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
406
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
407 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
408 enew!
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
409 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
410 endfunction
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
411
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
412 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
413 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
414 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
415
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
416 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
417 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
418 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
419
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
420 " 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
421 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
422 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
423 call assert_fails('set listchars=multispace', 'E474:')
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
424 call assert_fails('set listchars=leadmultispace', 'E474:')
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
425
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
426 " 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
427 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
428 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
429 call assert_fails('set listchars=multispace:', 'E474:')
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
430 call assert_fails('set listchars=leadmultispace:', 'E474:')
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
431
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
432 " 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
433 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
434 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
435 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
436 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
437 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
438 call assert_fails('set listchars=multispace:x,multispace:', 'E474:')
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
439 call assert_fails('set listchars=leadmultispace:,leadmultispace:x', 'E474:')
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
440 call assert_fails('set listchars=leadmultispace:x,leadmultispace:', 'E474:')
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
441
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
442 " 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
443 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
444 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
445
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
446 " 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
447 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
448 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
449 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
450 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
451 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
452 call assert_fails('set listchars=multispace:xxx·', 'E474:')
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
453 call assert_fails('set listchars=leadmultispace:·', 'E474:')
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
454 call assert_fails('set listchars=leadmultispace:xxx·', 'E474:')
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
455
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
456 " 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
457 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
458 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
459 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
460 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
461 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
462 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
463 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
464 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
465 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
466 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
467 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
468 call assert_fails('set listchars=multispace:xxx\\x01', 'E474:')
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
469 call assert_fails("set listchars=leadmultispace:\x01", 'E474:')
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
470 call assert_fails('set listchars=leadmultispace:\\x01', 'E474:')
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
471 call assert_fails("set listchars=leadmultispace:xxx\x01", 'E474:')
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
472 call assert_fails('set listchars=leadmultispace:xxx\\x01', 'E474:')
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
473
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
474 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
475 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
476 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
477
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
478 " 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
479 " 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
480 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
481 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
482 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
483 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
484 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
485 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
486
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
487 set listchars=eol:$,space:_,nbsp:=
31849
dbec60b8c253 patch 9.0.1257: code style is not check in test scripts
Bram Moolenaar <Bram@vim.org>
parents: 30580
diff changeset
488
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
489 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
490 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
491 call append(0, [
24198
c784e176334c patch 8.2.2640: screenstring() returns non-existing composing characters
Bram Moolenaar <Bram@vim.org>
parents: 23956
diff changeset
492 \ " \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
493 \ ])
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
494 let expected = [
24198
c784e176334c patch 8.2.2640: screenstring() returns non-existing composing characters
Bram Moolenaar <Bram@vim.org>
parents: 23956
diff changeset
495 \ "_ \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
496 \ ]
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
497 call Check_listchars(expected, 1)
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
498 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
499 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
500 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
501 endfunction
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 18035
diff changeset
502
23952
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
503 " 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
504 func s:CheckListCharsValue(expected)
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
505 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
506 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
507 endfunc
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
508
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
509 " 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
510 func Test_listchars_window_local()
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
511 %bw!
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
512 set list listchars&
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
513 new
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
514 " 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
515 setlocal listchars=tab:+-,eol:#
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
516 call s:CheckListCharsValue('tab:+-,eol:#')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
517 " 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
518 setlocal listchars=
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
519 call s:CheckListCharsValue('eol:$')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
520 " 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
521 setlocal listchars=space:.,extends:>
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
522 setlocal listchars<
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
523 call s:CheckListCharsValue('eol:$')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
524 " 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
525 setlocal listchars=space:.,extends:>
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
526 set listchars<
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
527 call s:CheckListCharsValue('eol:$')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
528 " 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
529 setlocal listchars=space:.,extends:>
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
530 setglobal listchars=tab:+-,eol:#
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
531 call s:CheckListCharsValue('space:.,extends:>')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
532 " 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
533 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
534 call s:CheckListCharsValue('space:.,extends:>')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
535 " 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
536 set listchars&
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
537 call s:CheckListCharsValue('eol:$')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
538 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
539 call s:CheckListCharsValue('space:.,extends:>')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
540
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
541 " 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
542 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
543 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
544 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
545 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
546 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
547 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
548 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
549 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
550 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
551 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
552 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
553 " 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
554 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
555 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
556 set listchars<
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
557 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
558
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
559 " 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
560 " 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
561 enew! | only
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
562 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
563 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
564 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
565 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
566 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
567 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
568 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
569 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
570 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
571 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
572 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
573 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
574
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
575 " 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
576 " using a local setting.
23952
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
577 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
578 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
579 setglobal listchars&vim
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
580 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
581 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
582 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
583
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
584 " 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
585 " using a global setting.
23952
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
586 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
587 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
588 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
589 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
590 setlocal listchars&vim
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
591 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
592 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
593 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
594
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
595 " 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
596 " 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
597 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
598 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
599 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
600 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
601 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
602 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
603 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
604
23956
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
605 " 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
606 " global settings.
23956
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
607 split
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
608 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
609 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
610 call assert_fails(cmd, 'E474:')
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
611 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
612 close
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
613 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
614
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
615 " 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
616 " global settings.
23956
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
617 split
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
618 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
619 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
620 call assert_fails(cmd, 'E474:')
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
621 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
622 close
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
623 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
624
26077
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
625 " 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
626 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
627 split
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
628 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
629 close
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
630
23952
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
631 %bw!
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
632 set list& listchars&
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
633 endfunc
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
634
25170
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
635 func Test_listchars_foldcolumn()
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
636 CheckScreendump
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
637
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
638 let lines =<< trim END
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
639 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
640 vsplit
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
641 vsplit
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
642 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
643 END
30580
f08ed0738f7a patch 9.0.0625: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents: 29090
diff changeset
644 call writefile(lines, 'XTest_listchars', 'D')
25170
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
645
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
646 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
647
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
648 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
649 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
650 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
651 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
652 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
653 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
654 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
655 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
656 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
657 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
658 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
659 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
660 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
661 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
662 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
663 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
664
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
665 " clean up
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
666 call StopVimInTerminal(buf)
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
667 endfunc
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
668
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
669
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 18035
diff changeset
670 " vim: shiftwidth=2 sts=2 expandtab