diff options
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r-- | test/functional/helpers.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index a31d2d5b44..dff4a7f13c 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -631,6 +631,9 @@ module.uimeths = module.create_callindex(ui) local function create_api(request, call) local m = {} function m.nvim(method, ...) + if vim.startswith(method, 'nvim_') then + return request(method, ...) + end return request('nvim_' .. method, ...) end @@ -700,6 +703,9 @@ module.describe_lua_and_rpc = function(describe) end end +--- add for typing. The for loop after will overwrite this +module.meths = vim.api + for name, fn in pairs(module.rpc.api) do module[name] = fn end @@ -862,11 +868,11 @@ function module.skip_fragile(pending_fn, cond) end function module.exec(code) - module.meths.exec2(code, {}) + module.meths.nvim_exec2(code, {}) end function module.exec_capture(code) - return module.meths.exec2(code, { output = true }).output + return module.meths.nvim_exec2(code, { output = true }).output end --- @param code string |