mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
fix(lua): preserve argument lists which are not lists
This commit is contained in:
@@ -17,6 +17,7 @@ local matches = helpers.matches
|
||||
local source = helpers.source
|
||||
local NIL = helpers.NIL
|
||||
local retry = helpers.retry
|
||||
local next_msg = helpers.next_msg
|
||||
|
||||
before_each(clear)
|
||||
|
||||
@@ -2178,6 +2179,24 @@ describe('lua stdlib', function()
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('vim.schedule_wrap', function()
|
||||
it('preserves argument lists', function()
|
||||
exec_lua [[
|
||||
local fun = vim.schedule_wrap(function(kling, klang, klonk)
|
||||
vim.rpcnotify(1, 'mayday_mayday', {a=kling, b=klang, c=klonk})
|
||||
end)
|
||||
fun("BOB", nil, "MIKE")
|
||||
]]
|
||||
eq({'notification', 'mayday_mayday', {{a='BOB', c='MIKE'}}}, next_msg())
|
||||
|
||||
-- let's gooooo
|
||||
exec_lua [[
|
||||
vim.schedule_wrap(function(...) vim.rpcnotify(1, 'boogalo', select('#', ...)) end)(nil,nil,nil,nil)
|
||||
]]
|
||||
eq({'notification', 'boogalo', {4}}, next_msg())
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('vim.api.nvim_buf_call', function()
|
||||
it('can access buf options', function()
|
||||
local buf1 = meths.get_current_buf()
|
||||
|
||||
Reference in New Issue
Block a user