mirror of
https://github.com/neovim/neovim.git
synced 2026-05-26 14:58:28 +00:00
refactor(lua): move vim.wait into runtime Lua
Move vim.wait into runtime/lua/vim/_core/editor.lua and replace the C entrypoint with narrow vim._core helpers for polling, UI flushing, and interrupt checks. Keep the existing interval semantics by retaining the dummy timer that wakes the loop while it is otherwise idle. Update the docs to describe the success return values correctly, and adjust the test expectation for the new vim.validate() callback error. AI-assisted: Codex
This commit is contained in:
committed by
Lewis Russell
parent
4431713285
commit
c822a2657c
@@ -2371,10 +2371,9 @@ describe('lua stdlib', function()
|
||||
end)
|
||||
|
||||
it('callback must be a function', function()
|
||||
eq(
|
||||
{ false, 'vim.wait: callback must be callable' },
|
||||
exec_lua [[return {pcall(function() vim.wait(1000, 13) end)}]]
|
||||
)
|
||||
local result = exec_lua [[return {pcall(function() vim.wait(1000, 13) end)}]]
|
||||
eq(false, result[1])
|
||||
matches('callback: expected callable, got number$', remove_trace(result[2]))
|
||||
end)
|
||||
|
||||
it('waits if callback arg is nil', function()
|
||||
|
||||
Reference in New Issue
Block a user