mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 09:12:07 +00:00
feat(api): relax statusline fillchar width check
Treat fillchar as single-width even if it isn't.
This commit is contained in:
@@ -2621,24 +2621,24 @@ describe('API', 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 = '哦' }))
|
||||
it('treats double-width fillchar as single-width', function()
|
||||
eq({ str = 'a哦哦哦b', width = 5 },
|
||||
meths.eval_statusline('a%=b', { fillchar = '哦', maxwidth = 5 }))
|
||||
end)
|
||||
it('rejects control character fillchar', function()
|
||||
eq('fillchar must be a single-width character',
|
||||
pcall_err(meths.eval_statusline, '', { fillchar = '\a' }))
|
||||
it('treats control character fillchar as single-width', function()
|
||||
eq({ str = 'a\031\031\031b', width = 5 },
|
||||
meths.eval_statusline('a%=b', { fillchar = '\031', maxwidth = 5 }))
|
||||
end)
|
||||
it('rejects multiple-character fillchar', function()
|
||||
eq('fillchar must be a single-width character',
|
||||
eq('fillchar must be a single character',
|
||||
pcall_err(meths.eval_statusline, '', { fillchar = 'aa' }))
|
||||
end)
|
||||
it('rejects empty string fillchar', function()
|
||||
eq('fillchar must be a single-width character',
|
||||
eq('fillchar must be a single character',
|
||||
pcall_err(meths.eval_statusline, '', { fillchar = '' }))
|
||||
end)
|
||||
it('rejects non-string fillchar', function()
|
||||
eq('fillchar must be a single-width character',
|
||||
eq('fillchar must be a single character',
|
||||
pcall_err(meths.eval_statusline, '', { fillchar = 1 }))
|
||||
end)
|
||||
describe('highlight parsing', function()
|
||||
|
Reference in New Issue
Block a user