Mercurial > vim
comparison src/testdir/test_listchars.vim @ 26634:c75f70257cf5 v8.2.3846
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Commit: https://github.com/vim/vim/commit/60618c8f1a7ea55452837a446525272142286471
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sat Dec 18 15:32:46 2021 +0000
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Problem: No error when using control character for 'lcs' or 'fcs'.
Solution: Use char2cells() to check the width. (closes https://github.com/vim/vim/issues/9369)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 18 Dec 2021 16:45:03 +0100 |
parents | ad90d7eee236 |
children | 9b292596a332 |
comparison
equal
deleted
inserted
replaced
26633:d324ddf09172 | 26634:c75f70257cf5 |
---|---|
331 | 331 |
332 " Too long | 332 " Too long |
333 call assert_fails('set listchars=space:xx', 'E474:') | 333 call assert_fails('set listchars=space:xx', 'E474:') |
334 call assert_fails('set listchars=tab:xxxx', 'E474:') | 334 call assert_fails('set listchars=tab:xxxx', 'E474:') |
335 | 335 |
336 " Has non-single width character | 336 " Has double-width character |
337 call assert_fails('set listchars=space:·', 'E474:') | 337 call assert_fails('set listchars=space:·', 'E474:') |
338 call assert_fails('set listchars=tab:·x', 'E474:') | 338 call assert_fails('set listchars=tab:·x', 'E474:') |
339 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:') | 340 call assert_fails('set listchars=tab:xx·', 'E474:') |
341 call assert_fails('set listchars=multispace:·', 'E474:') | 341 call assert_fails('set listchars=multispace:·', 'E474:') |
342 call assert_fails('set listchars=multispace:xxx·', 'E474:') | 342 call assert_fails('set listchars=multispace:xxx·', 'E474:') |
343 | |
344 " 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:') | |
343 | 357 |
344 enew! | 358 enew! |
345 set ambiwidth& listchars& ff& | 359 set ambiwidth& listchars& ff& |
346 endfunction | 360 endfunction |
347 | 361 |