1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 10:00:06 +08:00
SpaceVim/bundle/plenary.nvim/lua/plenary/async_lib/api.lua
2022-05-16 22:20:10 +08:00

16 lines
337 B
Lua

local a = require "plenary.async_lib.async"
local async, await = a.async, a.await
return setmetatable({}, {
__index = function(t, k)
return async(function(...)
-- if we are in a fast event await the scheduler
if vim.in_fast_event() then
await(a.scheduler())
end
vim.api[k](...)
end)
end,
})