mirror of
https://github.com/neovim/neovim.git
synced 2026-02-22 10:22:17 +10:00
fix(lua): vim.wait(math.huge) fails #36885
Problem:
`nlua_wait()` uses `luaL_checkinteger()` which doesn't support
`math.huge` since it's double type. On PUC Lua this fails with
'number has no integer representation' error and on LuaJIT this
overflows int.
Solution:
Use `luaL_checknumber()` and handle `math.huge`.
(cherry picked from commit bc0635a9fc)
This commit is contained in:
committed by
github-actions[bot]
parent
c1c0078138
commit
9acbf5102f
@@ -3768,7 +3768,8 @@ stack traceback:
|
||||
exec_lua([[
|
||||
function _G.Wait()
|
||||
vim.rpcnotify(vim.g.channel, 'ready')
|
||||
local _, interrupted = vim.wait(4000)
|
||||
-- handles math.huge #36854
|
||||
local _, interrupted = vim.wait(math.huge)
|
||||
vim.rpcnotify(vim.g.channel, 'wait', interrupted)
|
||||
end
|
||||
]])
|
||||
@@ -3782,7 +3783,7 @@ stack traceback:
|
||||
exec_lua([[
|
||||
function _G.Wait()
|
||||
vim.rpcnotify(vim.g.channel, 'ready')
|
||||
local _, interrupted = vim.wait(4000, function() end)
|
||||
local _, interrupted = vim.wait(math.huge, function() end)
|
||||
vim.rpcnotify(vim.g.channel, 'wait', interrupted)
|
||||
end
|
||||
]])
|
||||
|
||||
Reference in New Issue
Block a user