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

Invoke nvim_get_mode() to ensure that pending input is processed.
This commit is contained in:
zeertzjq
2025-09-16 07:30:43 +08:00
committed by GitHub
parent 47b0a718c3
commit 1bafba31f6

View File

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