diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-02-01 17:57:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-01 17:57:01 +0800 |
commit | f4300985d3212887ef27d703ba8cb4230813e095 (patch) | |
tree | 84e7780c8d66dbad94673911b704509e22155a07 /test/functional/api/vim_spec.lua | |
parent | a562b5771ea91becd0a469378ec852feaf50d2d0 (diff) | |
parent | be15ac06badbea6b11390ad7d9c2ddd4aea73480 (diff) | |
download | rneovim-f4300985d3212887ef27d703ba8cb4230813e095.tar.gz rneovim-f4300985d3212887ef27d703ba8cb4230813e095.tar.bz2 rneovim-f4300985d3212887ef27d703ba8cb4230813e095.zip |
Merge pull request #17113 from zeertzjq/vim-8.2.2569
feat(statusline): support multibyte fillchar
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 201ba45803..b5b10c049e 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -2551,6 +2551,34 @@ describe('API', function() 'Should be truncated%<', { maxwidth = 15 })) end) + it('supports ASCII fillchar', function() + eq({ str = 'a~~~b', width = 5 }, + meths.eval_statusline('a%=b', { fillchar = '~', maxwidth = 5 })) + end) + it('supports single-width multibyte fillchar', function() + eq({ str = 'a━━━b', width = 5 }, + meths.eval_statusline('a%=b', { fillchar = '━', maxwidth = 5 })) + end) + it('rejects double-width fillchar', function() + eq('fillchar must be a single-width character', + pcall_err(meths.eval_statusline, '', { fillchar = '哦' })) + end) + it('rejects control character fillchar', function() + eq('fillchar must be a single-width character', + pcall_err(meths.eval_statusline, '', { fillchar = '\a' })) + end) + it('rejects multiple-character fillchar', function() + eq('fillchar must be a single-width character', + pcall_err(meths.eval_statusline, '', { fillchar = 'aa' })) + end) + it('rejects empty string fillchar', function() + eq('fillchar must be a single-width character', + pcall_err(meths.eval_statusline, '', { fillchar = '' })) + end) + it('rejects non-string fillchar', function() + eq('fillchar must be a single-width character', + pcall_err(meths.eval_statusline, '', { fillchar = 1 })) + end) describe('highlight parsing', function() it('works', function() eq({ |