blob: 90e3d6b24195de4f4f612e78a6756713c204c066 [file] [log] [blame]
Bram Moolenaar209d3872017-11-16 21:52:51 +01001" Tests for 'listchars' display with 'list' and :list
2
Bram Moolenaar41fb7232021-07-08 12:40:05 +02003source check.vim
Bram Moolenaar209d3872017-11-16 21:52:51 +01004source view_util.vim
Bram Moolenaar41fb7232021-07-08 12:40:05 +02005source screendump.vim
Bram Moolenaar209d3872017-11-16 21:52:51 +01006
7func Test_listchars()
8 enew!
9 set ff=unix
10 set list
11
12 set listchars+=tab:>-,space:.,trail:<
13 call append(0, [
14 \ ' aa ',
15 \ ' bb ',
16 \ ' cccc ',
17 \ 'dd ee ',
18 \ ' '
19 \ ])
20 let expected = [
21 \ '>-------aa>-----$',
22 \ '..bb>---<<$',
23 \ '...cccc><$',
24 \ 'dd........ee<<>-$',
25 \ '<$'
26 \ ]
27 redraw!
28 for i in range(1, 5)
29 call cursor(i, 1)
Bram Moolenaarf92e58c2019-09-08 21:51:41 +020030 call assert_equal([expected[i - 1]], ScreenLines(i, '$'->virtcol()))
Bram Moolenaar209d3872017-11-16 21:52:51 +010031 endfor
32
33 set listchars-=trail:<
34 let expected = [
35 \ '>-------aa>-----$',
36 \ '..bb>---..$',
37 \ '...cccc>.$',
38 \ 'dd........ee..>-$',
39 \ '.$'
40 \ ]
41 redraw!
42 for i in range(1, 5)
43 call cursor(i, 1)
44 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
45 endfor
46
Bram Moolenaar83a52172019-01-16 22:41:54 +010047 " tab with 3rd character.
48 set listchars-=tab:>-
49 set listchars+=tab:<=>,trail:-
50 let expected = [
51 \ '<======>aa<====>$',
52 \ '..bb<==>--$',
53 \ '...cccc>-$',
54 \ 'dd........ee--<>$',
55 \ '-$'
56 \ ]
57 redraw!
58 for i in range(1, 5)
59 call cursor(i, 1)
60 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
61 endfor
62
Bram Moolenaar69cbbec2019-08-17 14:10:56 +020063 " tab with 3rd character and linebreak set
64 set listchars-=tab:<=>
65 set listchars+=tab:<·>
66 set linebreak
67 let expected = [
68 \ '<······>aa<····>$',
69 \ '..bb<··>--$',
70 \ '...cccc>-$',
71 \ 'dd........ee--<>$',
72 \ '-$'
73 \ ]
74 redraw!
75 for i in range(1, 5)
76 call cursor(i, 1)
77 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
78 endfor
79 set nolinebreak
80 set listchars-=tab:<·>
81 set listchars+=tab:<=>
82
Bram Moolenaar83a52172019-01-16 22:41:54 +010083 set listchars-=trail:-
84 let expected = [
85 \ '<======>aa<====>$',
86 \ '..bb<==>..$',
87 \ '...cccc>.$',
88 \ 'dd........ee..<>$',
89 \ '.$'
90 \ ]
91 redraw!
92 for i in range(1, 5)
93 call cursor(i, 1)
94 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
95 endfor
96
97 set listchars-=tab:<=>
98 set listchars+=tab:>-
Bram Moolenaar209d3872017-11-16 21:52:51 +010099 set listchars+=trail:<
100 set nolist
101 normal ggdG
102 call append(0, [
103 \ ' fff ',
104 \ ' gg ',
105 \ ' h ',
106 \ 'iii ',
107 \ ])
108 let l = split(execute("%list"), "\n")
109 call assert_equal([
110 \ '..fff>--<<$',
111 \ '>-------gg>-----$',
112 \ '.....h>-$',
113 \ 'iii<<<<><<$', '$'], l)
114
Bram Moolenaar91478ae2021-02-03 15:58:13 +0100115 " Test lead and trail
116 normal ggdG
117 set listchars&
118 set listchars+=lead:>,trail:<,space:x
119 set list
120
121 call append(0, [
122 \ ' ffff ',
123 \ ' gg',
124 \ 'h ',
125 \ ' ',
126 \ ' 0 0 ',
127 \ ])
128
129 let expected = [
130 \ '>>>>ffff<<<<$',
131 \ '>>>>>>>>>>gg$',
132 \ 'h<<<<<<<<<<<$',
133 \ '<<<<<<<<<<<<$',
134 \ '>>>>0xx0<<<<$',
135 \ '$'
136 \ ]
137 redraw!
138 for i in range(1, 5)
139 call cursor(i, 1)
140 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
141 endfor
142
143 call assert_equal(expected, split(execute("%list"), "\n"))
Bram Moolenaar895d9662019-01-31 21:57:21 +0100144
zeertzjqf14b8ba2021-09-10 16:58:30 +0200145 " Test multispace
146 normal ggdG
147 set listchars&
148 set listchars+=multispace:yYzZ
149 set list
150
151 call append(0, [
152 \ ' ffff ',
153 \ ' i i gg',
154 \ ' h ',
155 \ ' j ',
156 \ ' 0 0 ',
157 \ ])
158
159 let expected = [
160 \ 'yYzZffffyYzZ$',
161 \ 'yYi iyYzZygg$',
162 \ ' hyYzZyYzZyY$',
163 \ 'yYzZyYzZyYj $',
164 \ 'yYzZ0yY0yYzZ$',
165 \ '$'
166 \ ]
167 redraw!
168 for i in range(1, 5)
169 call cursor(i, 1)
170 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
171 endfor
172
173 call assert_equal(expected, split(execute("%list"), "\n"))
174
175 " the last occurrence of 'multispace:' is used
176 set listchars+=space:x,multispace:XyY
177
178 let expected = [
179 \ 'XyYXffffXyYX$',
180 \ 'XyixiXyYXygg$',
181 \ 'xhXyYXyYXyYX$',
182 \ 'XyYXyYXyYXjx$',
183 \ 'XyYX0Xy0XyYX$',
184 \ '$'
185 \ ]
186 redraw!
187 for i in range(1, 5)
188 call cursor(i, 1)
189 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
190 endfor
191
192 call assert_equal(expected, split(execute("%list"), "\n"))
193
194 set listchars+=lead:>,trail:<
195
196 let expected = [
197 \ '>>>>ffff<<<<$',
198 \ '>>ixiXyYXygg$',
199 \ '>h<<<<<<<<<<$',
200 \ '>>>>>>>>>>j<$',
201 \ '>>>>0Xy0<<<<$',
202 \ '$'
203 \ ]
204 redraw!
205 for i in range(1, 5)
206 call cursor(i, 1)
207 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
208 endfor
209
210 call assert_equal(expected, split(execute("%list"), "\n"))
211
212 " removing 'multispace:'
213 set listchars-=multispace:XyY
214 set listchars-=multispace:yYzZ
215
216 let expected = [
217 \ '>>>>ffff<<<<$',
218 \ '>>ixixxxxxgg$',
219 \ '>h<<<<<<<<<<$',
220 \ '>>>>>>>>>>j<$',
221 \ '>>>>0xx0<<<<$',
222 \ '$'
223 \ ]
224 redraw!
225 for i in range(1, 5)
226 call cursor(i, 1)
227 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
228 endfor
229
230 call assert_equal(expected, split(execute("%list"), "\n"))
231
Bram Moolenaar895d9662019-01-31 21:57:21 +0100232 " test nbsp
233 normal ggdG
234 set listchars=nbsp:X,trail:Y
235 set list
236 " Non-breaking space
237 let nbsp = nr2char(0xa0)
Bram Moolenaarf1387282021-03-22 17:11:15 +0100238 call append(0, [ ">" .. nbsp .. "<" ])
Bram Moolenaar895d9662019-01-31 21:57:21 +0100239
240 let expected = '>X< '
241
242 redraw!
243 call cursor(1, 1)
244 call assert_equal([expected], ScreenLines(1, virtcol('$')))
245
246 set listchars=nbsp:X
247 redraw!
248 call cursor(1, 1)
249 call assert_equal([expected], ScreenLines(1, virtcol('$')))
250
Bram Moolenaara5c6a0b2019-05-08 20:20:46 +0200251 " test extends
252 normal ggdG
253 set listchars=extends:Z
254 set nowrap
255 set nolist
256 call append(0, [ repeat('A', &columns + 1) ])
257
258 let expected = repeat('A', &columns)
259
260 redraw!
261 call cursor(1, 1)
262 call assert_equal([expected], ScreenLines(1, &columns))
263
264 set list
265 let expected = expected[:-2] . 'Z'
266 redraw!
267 call cursor(1, 1)
268 call assert_equal([expected], ScreenLines(1, &columns))
269
Bram Moolenaar209d3872017-11-16 21:52:51 +0100270 enew!
271 set listchars& ff&
272endfunc
Bram Moolenaar5f8069b2019-03-30 15:34:47 +0100273
Bram Moolenaare5e4e222019-04-04 13:28:45 +0200274" Test that unicode listchars characters get properly inserted
275func Test_listchars_unicode()
276 enew!
277 let oldencoding=&encoding
278 set encoding=utf-8
279 set ff=unix
280
zeertzjqf14b8ba2021-09-10 16:58:30 +0200281 set listchars=eol:⇔,space:␣,multispace:≡≢≣,nbsp:≠,tab:←↔→
Bram Moolenaare5e4e222019-04-04 13:28:45 +0200282 set list
283
284 let nbsp = nr2char(0xa0)
zeertzjqf14b8ba2021-09-10 16:58:30 +0200285 call append(0, [" a\tb c" .. nbsp .. "d "])
286 let expected = ['≡≢≣≡≢≣≡≢a←↔↔↔↔↔→b␣c≠d≡≢⇔']
Bram Moolenaare5e4e222019-04-04 13:28:45 +0200287 redraw!
288 call cursor(1, 1)
289 call assert_equal(expected, ScreenLines(1, virtcol('$')))
zeertzjqf14b8ba2021-09-10 16:58:30 +0200290
Bram Moolenaar93ff6722021-10-16 17:51:40 +0100291 set listchars=eol:\\u21d4,space:\\u2423,multispace:≡\\u2262\\U00002263,nbsp:\\U00002260,tab:←↔\\u2192
292 redraw!
293 call assert_equal(expected, ScreenLines(1, virtcol('$')))
294
zeertzjqf14b8ba2021-09-10 16:58:30 +0200295 set listchars+=lead:⇨,trail:⇦
296 let expected = ['⇨⇨⇨⇨⇨⇨⇨⇨a←↔↔↔↔↔→b␣c≠d⇦⇦⇔']
297 redraw!
298 call cursor(1, 1)
299 call assert_equal(expected, ScreenLines(1, virtcol('$')))
300
Bram Moolenaare5e4e222019-04-04 13:28:45 +0200301 let &encoding=oldencoding
302 enew!
303 set listchars& ff&
304endfunction
305
zeertzjqf14b8ba2021-09-10 16:58:30 +0200306func Test_listchars_invalid()
307 enew!
308 set ff=unix
309
310 set listchars&
311 set list
312 set ambiwidth=double
313
314 " No colon
315 call assert_fails('set listchars=x', 'E474:')
316 call assert_fails('set listchars=x', 'E474:')
317 call assert_fails('set listchars=multispace', 'E474:')
318
319 " Too short
320 call assert_fails('set listchars=space:', 'E474:')
321 call assert_fails('set listchars=tab:x', 'E474:')
322 call assert_fails('set listchars=multispace:', 'E474:')
323
324 " One occurrence too short
325 call assert_fails('set listchars=space:,space:x', 'E474:')
326 call assert_fails('set listchars=space:x,space:', 'E474:')
327 call assert_fails('set listchars=tab:x,tab:xx', 'E474:')
328 call assert_fails('set listchars=tab:xx,tab:x', 'E474:')
329 call assert_fails('set listchars=multispace:,multispace:x', 'E474:')
330 call assert_fails('set listchars=multispace:x,multispace:', 'E474:')
331
332 " Too long
333 call assert_fails('set listchars=space:xx', 'E474:')
334 call assert_fails('set listchars=tab:xxxx', 'E474:')
335
zeertzjq60618c82021-12-18 15:32:46 +0000336 " Has double-width character
zeertzjqf14b8ba2021-09-10 16:58:30 +0200337 call assert_fails('set listchars=space:·', 'E474:')
338 call assert_fails('set listchars=tab:·x', 'E474:')
339 call assert_fails('set listchars=tab:x·', 'E474:')
340 call assert_fails('set listchars=tab:xx·', 'E474:')
341 call assert_fails('set listchars=multispace:·', 'E474:')
342 call assert_fails('set listchars=multispace:xxx·', 'E474:')
343
zeertzjq60618c82021-12-18 15:32:46 +0000344 " Has control character
345 call assert_fails("set listchars=space:\x01", 'E474:')
346 call assert_fails("set listchars=tab:\x01x", 'E474:')
347 call assert_fails("set listchars=tab:x\x01", 'E474:')
348 call assert_fails("set listchars=tab:xx\x01", 'E474:')
349 call assert_fails("set listchars=multispace:\x01", 'E474:')
350 call assert_fails("set listchars=multispace:xxx\x01", 'E474:')
351 call assert_fails('set listchars=space:\\x01', 'E474:')
352 call assert_fails('set listchars=tab:\\x01x', 'E474:')
353 call assert_fails('set listchars=tab:x\\x01', 'E474:')
354 call assert_fails('set listchars=tab:xx\\x01', 'E474:')
355 call assert_fails('set listchars=multispace:\\x01', 'E474:')
356 call assert_fails('set listchars=multispace:xxx\\x01', 'E474:')
357
zeertzjqf14b8ba2021-09-10 16:58:30 +0200358 enew!
359 set ambiwidth& listchars& ff&
360endfunction
361
Bram Moolenaare5e4e222019-04-04 13:28:45 +0200362" Tests that space characters following composing character won't get replaced
363" by listchars.
Bram Moolenaar5f8069b2019-03-30 15:34:47 +0100364func Test_listchars_composing()
365 enew!
366 let oldencoding=&encoding
367 set encoding=utf-8
368 set ff=unix
369 set list
370
Bram Moolenaare5e4e222019-04-04 13:28:45 +0200371 set listchars=eol:$,space:_,nbsp:=
372
373 let nbsp1 = nr2char(0xa0)
374 let nbsp2 = nr2char(0x202f)
Bram Moolenaar5f8069b2019-03-30 15:34:47 +0100375 call append(0, [
Bram Moolenaarf1387282021-03-22 17:11:15 +0100376 \ " \u3099\t \u309A" .. nbsp1 .. nbsp1 .. "\u0302" .. nbsp2 .. nbsp2 .. "\u0302",
Bram Moolenaar5f8069b2019-03-30 15:34:47 +0100377 \ ])
378 let expected = [
Bram Moolenaarf1387282021-03-22 17:11:15 +0100379 \ "_ \u3099^I \u309A=" .. nbsp1 .. "\u0302=" .. nbsp2 .. "\u0302$"
Bram Moolenaar5f8069b2019-03-30 15:34:47 +0100380 \ ]
381 redraw!
382 call cursor(1, 1)
Bram Moolenaare5e4e222019-04-04 13:28:45 +0200383 call assert_equal(expected, ScreenLines(1, virtcol('$')))
Bram Moolenaar5f8069b2019-03-30 15:34:47 +0100384 let &encoding=oldencoding
Bram Moolenaare5e4e222019-04-04 13:28:45 +0200385 enew!
Bram Moolenaar5f8069b2019-03-30 15:34:47 +0100386 set listchars& ff&
387endfunction
Bram Moolenaar6d91bcb2020-08-12 18:50:36 +0200388
Bram Moolenaareed9d462021-02-15 20:38:25 +0100389" Check for the value of the 'listchars' option
390func s:CheckListCharsValue(expected)
391 call assert_equal(a:expected, &listchars)
392 call assert_equal(a:expected, getwinvar(0, '&listchars'))
393endfunc
394
395" Test for using a window local value for 'listchars'
396func Test_listchars_window_local()
397 %bw!
398 set list listchars&
399 new
400 " set a local value for 'listchars'
401 setlocal listchars=tab:+-,eol:#
402 call s:CheckListCharsValue('tab:+-,eol:#')
403 " When local value is reset, global value should be used
404 setlocal listchars=
405 call s:CheckListCharsValue('eol:$')
406 " Use 'setlocal <' to copy global value
407 setlocal listchars=space:.,extends:>
408 setlocal listchars<
409 call s:CheckListCharsValue('eol:$')
410 " Use 'set <' to copy global value
411 setlocal listchars=space:.,extends:>
412 set listchars<
413 call s:CheckListCharsValue('eol:$')
414 " Changing global setting should not change the local setting
415 setlocal listchars=space:.,extends:>
416 setglobal listchars=tab:+-,eol:#
417 call s:CheckListCharsValue('space:.,extends:>')
418 " when split opening a new window, local value should be copied
419 split
420 call s:CheckListCharsValue('space:.,extends:>')
421 " clearing local value in one window should not change the other window
422 set listchars&
423 call s:CheckListCharsValue('eol:$')
424 close
425 call s:CheckListCharsValue('space:.,extends:>')
426
427 " use different values for 'listchars' items in two different windows
428 call setline(1, ["\t one two "])
429 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
430 split
431 setlocal listchars=tab:[.],lead:#,space:_,trail:.,eol:&
432 split
433 set listchars=tab:+-+,lead:^,space:>,trail:<,eol:%
434 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
435 close
436 call assert_equal(['[......]##one__two..&'], ScreenLines(1, virtcol('$')))
437 close
438 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
439 " changing the global setting should not change the local value
440 setglobal listchars=tab:[.],lead:#,space:_,trail:.,eol:&
441 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
442 set listchars<
443 call assert_equal(['[......]##one__two..&'], ScreenLines(1, virtcol('$')))
444
445 " Using setglobal in a window with local setting should not affect the
446 " window. But should impact other windows using the global setting.
447 enew! | only
448 call setline(1, ["\t one two "])
449 set listchars=tab:[.],lead:#,space:_,trail:.,eol:&
450 split
451 setlocal listchars=tab:+-+,lead:^,space:>,trail:<,eol:%
452 split
453 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
454 setglobal listchars=tab:{.},lead:-,space:=,trail:#,eol:$
455 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
456 close
457 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
458 close
459 call assert_equal(['{......}--one==two##$'], ScreenLines(1, virtcol('$')))
460
461 " Setting the global setting to the default value should not impact a window
zeertzjq7a33ebf2021-11-02 20:56:07 +0000462 " using a local setting.
Bram Moolenaareed9d462021-02-15 20:38:25 +0100463 split
464 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
465 setglobal listchars&vim
466 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
467 close
468 call assert_equal(['^I one two $'], ScreenLines(1, virtcol('$')))
469
470 " Setting the local setting to the default value should not impact a window
zeertzjq7a33ebf2021-11-02 20:56:07 +0000471 " using a global setting.
Bram Moolenaareed9d462021-02-15 20:38:25 +0100472 set listchars=tab:{.},lead:-,space:=,trail:#,eol:$
473 split
474 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
475 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
476 setlocal listchars&vim
477 call assert_equal(['^I one two $'], ScreenLines(1, virtcol('$')))
478 close
479 call assert_equal(['{......}--one==two##$'], ScreenLines(1, virtcol('$')))
480
481 " Using set in a window with a local setting should change it to use the
zeertzjq7a33ebf2021-11-02 20:56:07 +0000482 " global setting and also impact other windows using the global setting.
Bram Moolenaareed9d462021-02-15 20:38:25 +0100483 split
484 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
485 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
486 set listchars=tab:+-+,lead:^,space:>,trail:<,eol:%
487 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
488 close
489 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
490
Bram Moolenaar04ea7e92021-02-16 21:14:33 +0100491 " Setting invalid value for a local setting should not impact the local and
zeertzjq7a33ebf2021-11-02 20:56:07 +0000492 " global settings.
Bram Moolenaar04ea7e92021-02-16 21:14:33 +0100493 split
494 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
495 let cmd = 'setlocal listchars=tab:{.},lead:-,space:=,trail:#,eol:$,x'
496 call assert_fails(cmd, 'E474:')
497 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
498 close
499 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
500
501 " Setting invalid value for a global setting should not impact the local and
zeertzjq7a33ebf2021-11-02 20:56:07 +0000502 " global settings.
Bram Moolenaar04ea7e92021-02-16 21:14:33 +0100503 split
504 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
505 let cmd = 'setglobal listchars=tab:{.},lead:-,space:=,trail:#,eol:$,x'
506 call assert_fails(cmd, 'E474:')
507 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
508 close
509 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
510
zeertzjq7a33ebf2021-11-02 20:56:07 +0000511 " Closing window with local lcs-multispace should not cause a memory leak.
512 setlocal listchars=multispace:---+
513 split
514 call s:CheckListCharsValue('multispace:---+')
515 close
516
Bram Moolenaareed9d462021-02-15 20:38:25 +0100517 %bw!
518 set list& listchars&
519endfunc
520
Bram Moolenaar41fb7232021-07-08 12:40:05 +0200521func Test_listchars_foldcolumn()
522 CheckScreendump
523
524 let lines =<< trim END
525 call setline(1, ['aaa', '', 'a', 'aaaaaa'])
526 vsplit
527 vsplit
528 windo set signcolumn=yes foldcolumn=1 winminwidth=0 nowrap list listchars=extends:>,precedes:<
529 END
530 call writefile(lines, 'XTest_listchars')
531
532 let buf = RunVimInTerminal('-S XTest_listchars', {'rows': 10, 'cols': 60})
533
534 call term_sendkeys(buf, "13\<C-W>>")
535 call VerifyScreenDump(buf, 'Test_listchars_01', {})
536 call term_sendkeys(buf, "\<C-W>>")
537 call VerifyScreenDump(buf, 'Test_listchars_02', {})
538 call term_sendkeys(buf, "\<C-W>>")
539 call VerifyScreenDump(buf, 'Test_listchars_03', {})
540 call term_sendkeys(buf, "\<C-W>>")
541 call VerifyScreenDump(buf, 'Test_listchars_04', {})
542 call term_sendkeys(buf, "\<C-W>>")
543 call VerifyScreenDump(buf, 'Test_listchars_05', {})
Bram Moolenaar30441bb2021-07-08 13:19:31 +0200544 call term_sendkeys(buf, "\<C-W>h")
545 call term_sendkeys(buf, ":set nowrap foldcolumn=4\<CR>")
546 call term_sendkeys(buf, "15\<C-W><")
547 call VerifyScreenDump(buf, 'Test_listchars_06', {})
548 call term_sendkeys(buf, "4\<C-W><")
549 call VerifyScreenDump(buf, 'Test_listchars_07', {})
Bram Moolenaar41fb7232021-07-08 12:40:05 +0200550
551 " clean up
552 call StopVimInTerminal(buf)
553 call delete('XTest_listchars')
554endfunc
555
556
Bram Moolenaar6d91bcb2020-08-12 18:50:36 +0200557" vim: shiftwidth=2 sts=2 expandtab