@@ -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 &
341361endfunc
0 commit comments