mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-04 16:40:06 +08:00
16 lines
337 B
Lua
Vendored
16 lines
337 B
Lua
Vendored
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,
|
|
})
|