fix(statuscolumn): fix crashes and clang/PVS warnings (#21725)

This commit is contained in:
zeertzjq
2023-01-10 21:18:12 +08:00
committed by GitHub
parent 870ca1de52
commit 9b1112cf48
6 changed files with 57 additions and 29 deletions

View File

@@ -3126,7 +3126,12 @@ describe('API', function()
eq('E539: Illegal character <}>',
pcall_err(meths.eval_statusline, '%{%}', {}))
end)
it('supports %S item', function()
it('supports various items', function()
eq({ str = '0', width = 1 },
meths.eval_statusline('%l', { maxwidth = 5 }))
command('set readonly')
eq({ str = '[RO]', width = 4 },
meths.eval_statusline('%r', { maxwidth = 5 }))
local screen = Screen.new(80, 24)
screen:attach()
command('set showcmd')