test(swapfile_preserve_recover_spec): fix flaky test (#35782)

Invoke nvim_get_mode() to ensure that pending input is processed.

(cherry picked from commit 1bafba31f6)
This commit is contained in:
zeertzjq
2025-09-16 07:30:43 +08:00
committed by github-actions[bot]
parent 693772100e
commit 777551c599

View File

@@ -191,7 +191,9 @@ pcall(vim.cmd.edit, 'Xtest_swapredraw.lua')
exec(init) exec(init)
command('autocmd! nvim.swapfile') -- Delete the default handler (which skips the dialog). command('autocmd! nvim.swapfile') -- Delete the default handler (which skips the dialog).
feed(':edit ' .. testfile .. '<CR>') feed(':edit ' .. testfile .. '<CR>')
eq('r?', api.nvim_get_mode().mode)
feed('E:source<CR>') feed('E:source<CR>')
eq('r?', api.nvim_get_mode().mode)
screen2:sleep(1000) screen2:sleep(1000)
feed('E') feed('E')
screen2:expect([[ screen2:expect([[