annotate src/testdir/test_listchars.vim @ 34157:e7d64a3fffe4 v9.1.0039

patch 9.1.0039: too vague errors for 'listchars'/'fillchars' Commit: https://github.com/vim/vim/commit/6a8d2e1634f8f0d7463a2786dbcbe0f38dd287a7 Author: zeertzjq <zeertzjq@outlook.com> Date: Wed Jan 17 20:54:49 2024 +0100 patch 9.1.0039: too vague errors for 'listchars'/'fillchars' Problem: too vague errors for 'listchars'/'fillchars' Solution: Include the field name in error message. (zeertzjq) related: neovim/neovim#27050 closes: #13877 Co-authored-by: Cole Frankenhoff <cole.nhf@gmail.com> Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 17 Jan 2024 21:15:03 +0100
parents 6c92d6f3a255
children
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
33821
6c92d6f3a255 patch 9.0.2126: unused assignments when checking 'listchars'
Christian Brabandt <cb@256bit.org>
parents: 33349
diff changeset
268 " Changing the value of 'ambiwidth' twice shouldn't cause double-free when
6c92d6f3a255 patch 9.0.2126: unused assignments when checking 'listchars'
Christian Brabandt <cb@256bit.org>
parents: 33349
diff changeset
269 " "leadmultispace" is specified.
6c92d6f3a255 patch 9.0.2126: unused assignments when checking 'listchars'
Christian Brabandt <cb@256bit.org>
parents: 33349
diff changeset
270 set ambiwidth=double
6c92d6f3a255 patch 9.0.2126: unused assignments when checking 'listchars'
Christian Brabandt <cb@256bit.org>
parents: 33349
diff changeset
271 set ambiwidth&
6c92d6f3a255 patch 9.0.2126: unused assignments when checking 'listchars'
Christian Brabandt <cb@256bit.org>
parents: 33349
diff changeset
272
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
273 " 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
274 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
275 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
276 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
277 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
278 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
279
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
280 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
281 \ ' ffff ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
282 \ ' 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
283 \ ' h ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
284 \ ' j ',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
285 \ ' 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
286 \ ])
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
287
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
288 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
289 \ '.-+*ffff----$',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
290 \ '.-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
291 \ '<h----------$',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
292 \ '.-+*.-+*.-j-$',
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
293 \ '.-+*0--0----$',
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
294 \ '$'
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
295 \ ]
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
296 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
297 call Check_listchars(expected, 6)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
298 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
299 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
300 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
301 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
302 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
303
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
304 " 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
305 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
306 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
307 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
308
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 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
310 \ '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
311 \ '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
312 \ '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
313 \ '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
314 \ 'XyYX0Xy0XyYX$',
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
315 \ '$'
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
316 \ ]
29090
9b292596a332 patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents: 26634
diff changeset
317 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
318 call Check_listchars(expected, 6)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
319 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
320 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
321
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 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
323
373278f5bd51 patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents: 25172
diff changeset
324 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
325 \ '>>>>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
326 \ '>>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
327 \ '>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
328 \ '>>>>>>>>>>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
329 \ '>>>>0Xy0<<<<$',
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
330 \ '$'
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
331 \ ]
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
332 call Check_listchars(expected, 6)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
333 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
334 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
335
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 " 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
337 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
338 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
339
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 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
341 \ '>>>>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
342 \ '>>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
343 \ '>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
344 \ '>>>>>>>>>>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
345 \ '>>>>0xx0<<<<$',
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
346 \ '$'
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
347 \ ]
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
348 call Check_listchars(expected, 6)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
349 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
350 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
351
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
352 " 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
353 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
354 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
355 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
356 " 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
357 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
358 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
359
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 let expected = '>X< '
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
361 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
362
52930462eec4 patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents: 15502
diff changeset
363 set listchars=nbsp:X
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
364 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
365
16592
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
366 " 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
367 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
368 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
369 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
370 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
371 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
372
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
373 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
374 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
375
80bb4ce2a281 patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents: 16211
diff changeset
376 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
377 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
378 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
379
12851
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
380 enew!
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
381 set listchars& ff&
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
382 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
383
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
384 " 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
385 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
386 enew!
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
387 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
388 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
389 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
390
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
391 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
392 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
393
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
394 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
395 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
396 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
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)
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
400
25978
40b17deb294f patch 8.2.3522: cannot use x and u when setting 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 25778
diff changeset
401 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
402 call Check_listchars(expected, 1)
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, -1, 3)
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, 13)
25978
40b17deb294f patch 8.2.3522: cannot use x and u when setting 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 25778
diff changeset
405
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 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
407 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
408 call Check_listchars(expected, 1)
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
409 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
410 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
411
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
412 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
413 enew!
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
414 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
415 endfunction
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
416
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
417 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
418 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
419 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
420
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 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
422 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
423 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
424
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 " 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
426 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
427 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
428 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
429 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
430
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 " Too short
34157
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
432 call assert_fails('set listchars=space:', 'E1511:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
433 call assert_fails('set listchars=tab:x', 'E1511:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
434 call assert_fails('set listchars=multispace:', 'E1511:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
435 call assert_fails('set listchars=leadmultispace:', 'E1511:')
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
436
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 " One occurrence too short
34157
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
438 call assert_fails('set listchars=space:x,space:', 'E1511:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
439 call assert_fails('set listchars=space:,space:x', 'E1511:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
440 call assert_fails('set listchars=tab:xx,tab:x', 'E1511:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
441 call assert_fails('set listchars=tab:x,tab:xx', 'E1511:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
442 call assert_fails('set listchars=multispace:,multispace:x', 'E1511:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
443 call assert_fails('set listchars=multispace:x,multispace:', 'E1511:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
444 call assert_fails('set listchars=leadmultispace:,leadmultispace:x', 'E1511:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
445 call assert_fails('set listchars=leadmultispace:x,leadmultispace:', 'E1511:')
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
446
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 " Too long
34157
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
448 call assert_fails('set listchars=space:xx', 'E1511:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
449 call assert_fails('set listchars=tab:xxxx', 'E1511:')
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
450
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
451 " Has double-width character
34157
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
452 call assert_fails('set listchars=space:·', 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
453 call assert_fails('set listchars=tab:·x', 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
454 call assert_fails('set listchars=tab:x·', 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
455 call assert_fails('set listchars=tab:xx·', 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
456 call assert_fails('set listchars=multispace:·', 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
457 call assert_fails('set listchars=multispace:xxx·', 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
458 call assert_fails('set listchars=leadmultispace:·', 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
459 call assert_fails('set listchars=leadmultispace:xxx·', 'E1512:')
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
460
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
461 " Has control character
34157
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
462 call assert_fails("set listchars=space:\x01", 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
463 call assert_fails("set listchars=tab:\x01x", 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
464 call assert_fails("set listchars=tab:x\x01", 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
465 call assert_fails("set listchars=tab:xx\x01", 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
466 call assert_fails("set listchars=multispace:\x01", 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
467 call assert_fails("set listchars=multispace:xxx\x01", 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
468 call assert_fails('set listchars=space:\\x01', 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
469 call assert_fails('set listchars=tab:\\x01x', 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
470 call assert_fails('set listchars=tab:x\\x01', 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
471 call assert_fails('set listchars=tab:xx\\x01', 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
472 call assert_fails('set listchars=multispace:\\x01', 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
473 call assert_fails('set listchars=multispace:xxx\\x01', 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
474 call assert_fails("set listchars=leadmultispace:\x01", 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
475 call assert_fails('set listchars=leadmultispace:\\x01', 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
476 call assert_fails("set listchars=leadmultispace:xxx\x01", 'E1512:')
e7d64a3fffe4 patch 9.1.0039: too vague errors for 'listchars'/'fillchars'
Christian Brabandt <cb@256bit.org>
parents: 33821
diff changeset
477 call assert_fails('set listchars=leadmultispace:xxx\\x01', 'E1512:')
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
478
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
479 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
480 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
481 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
482
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
483 " 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
484 " 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
485 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
486 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
487 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
488 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
489 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
490 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
491
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
492 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
493
16211
5fb0f15fafea patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents: 16148
diff changeset
494 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
495 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
496 call append(0, [
24198
c784e176334c patch 8.2.2640: screenstring() returns non-existing composing characters
Bram Moolenaar <Bram@vim.org>
parents: 23956
diff changeset
497 \ " \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
498 \ ])
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
499 let expected = [
24198
c784e176334c patch 8.2.2640: screenstring() returns non-existing composing characters
Bram Moolenaar <Bram@vim.org>
parents: 23956
diff changeset
500 \ "_ \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
501 \ ]
33349
e385bda5e345 patch 9.0.1938: multispace wrong when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 31849
diff changeset
502 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
503 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
504 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
505 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
506 endfunction
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 18035
diff changeset
507
23952
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
508 " 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
509 func s:CheckListCharsValue(expected)
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
510 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
511 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
512 endfunc
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
513
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
514 " 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
515 func Test_listchars_window_local()
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
516 %bw!
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
517 set list listchars&
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
518 new
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
519 " 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
520 setlocal listchars=tab:+-,eol:#
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
521 call s:CheckListCharsValue('tab:+-,eol:#')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
522 " 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
523 setlocal listchars=
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
524 call s:CheckListCharsValue('eol:$')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
525 " 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
526 setlocal listchars=space:.,extends:>
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
527 setlocal listchars<
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
528 call s:CheckListCharsValue('eol:$')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
529 " 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
530 setlocal listchars=space:.,extends:>
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
531 set listchars<
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
532 call s:CheckListCharsValue('eol:$')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
533 " 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
534 setlocal listchars=space:.,extends:>
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
535 setglobal listchars=tab:+-,eol:#
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
536 call s:CheckListCharsValue('space:.,extends:>')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
537 " 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
538 split
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 " 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
541 set listchars&
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
542 call s:CheckListCharsValue('eol:$')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
543 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
544 call s:CheckListCharsValue('space:.,extends:>')
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
545
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
546 " 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
547 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
548 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
549 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
550 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
551 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
552 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
553 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
554 close
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 close
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 " 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
559 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
560 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
561 set listchars<
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
562 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
563
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
564 " 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
565 " 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
566 enew! | only
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
567 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
568 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
569 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
570 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
571 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
572 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
573 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
574 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
575 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
576 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
577 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
578 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
579
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
580 " 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
581 " using a local setting.
23952
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
582 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
583 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
584 setglobal listchars&vim
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
585 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
586 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
587 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
588
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
589 " 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
590 " using a global setting.
23952
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
591 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
592 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
593 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
594 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
595 setlocal listchars&vim
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
596 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
597 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
598 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
599
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
600 " 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
601 " 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
602 split
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
603 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
604 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
605 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
606 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
607 close
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
608 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
609
23956
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
610 " 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
611 " global settings.
23956
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
612 split
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
613 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
614 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
615 call assert_fails(cmd, 'E474:')
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
616 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
617 close
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
618 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
619
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
620 " 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
621 " global settings.
23956
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
622 split
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
623 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
624 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
625 call assert_fails(cmd, 'E474:')
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
626 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
627 close
4d88e660ce32 patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
628 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
629
26077
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
630 " 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
631 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
632 split
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
633 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
634 close
ad90d7eee236 patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents: 25978
diff changeset
635
23952
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
636 %bw!
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
637 set list& listchars&
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
638 endfunc
44be09b25619 patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents: 23825
diff changeset
639
25170
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
640 func Test_listchars_foldcolumn()
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
641 CheckScreendump
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
642
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
643 let lines =<< trim END
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
644 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
645 vsplit
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
646 vsplit
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
647 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
648 END
30580
f08ed0738f7a patch 9.0.0625: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents: 29090
diff changeset
649 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
650
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
651 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
652
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
653 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
654 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
655 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
656 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
657 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
658 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
659 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
660 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
661 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
662 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
663 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
664 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
665 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
666 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
667 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
668 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
669
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
670 " clean up
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
671 call StopVimInTerminal(buf)
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
672 endfunc
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
673
ac54d215fbec patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents: 24198
diff changeset
674
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 18035
diff changeset
675 " vim: shiftwidth=2 sts=2 expandtab