Skip to content

Commit 04ea7e9

Browse files
committed
patch 8.2.2520: missing tests for 'listchars'
Problem: Missing tests for 'listchars'. Solution: Add a few more checks. (Yegappan Lakshmanan, closes #7854)
1 parent b855430 commit 04ea7e9

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

src/testdir/test_listchars.vim

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,26 @@ func Test_listchars_window_local()
336336
close
337337
call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
338338

339+
" Setting invalid value for a local setting should not impact the local and
340+
" global settings
341+
split
342+
setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
343+
let cmd = 'setlocal listchars=tab:{.},lead:-,space:=,trail:#,eol:$,x'
344+
call assert_fails(cmd, 'E474:')
345+
call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
346+
close
347+
call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
348+
349+
" Setting invalid value for a global setting should not impact the local and
350+
" global settings
351+
split
352+
setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
353+
let cmd = 'setglobal listchars=tab:{.},lead:-,space:=,trail:#,eol:$,x'
354+
call assert_fails(cmd, 'E474:')
355+
call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
356+
close
357+
call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
358+
339359
%bw!
340360
set list& listchars&
341361
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2520,
753755
/**/
754756
2519,
755757
/**/

0 commit comments

Comments
 (0)