fix(ui): send grid_resize events before triggering VimResized (#20760)

This commit is contained in:
zeertzjq
2022-10-22 07:53:39 +08:00
committed by GitHub
parent 90138d5ed8
commit 2f9b94a268
2 changed files with 46 additions and 31 deletions

View File

@@ -894,6 +894,31 @@ local function screen_tests(linegrid)
:ls^ |
]])
end)
it('VimResized autocommand does not cause invalid UI events #20692 #20759', function()
feed('<Esc>')
command([[autocmd VimResized * redrawtabline]])
command([[autocmd VimResized * lua vim.api.nvim_echo({ { 'Hello' } }, false, {})]])
command([[autocmd VimResized * let g:echospace = v:echospace]])
meths.set_option('showtabline', 2)
screen:expect([[
{2: + [No Name] }{3: }|
resiz^e |
{0:~ }|
{0:~ }|
|
]])
screen:try_resize(30, 6)
screen:expect([[
{2: + [No Name] }{3: }|
resiz^e |
{0:~ }|
{0:~ }|
{0:~ }|
|
]])
eq(29, meths.get_var('echospace'))
end)
end)
describe('press enter', function()