Improve scheduling

This commit is contained in:
hrsh7th
2021-08-27 21:34:34 +09:00
parent 63d6c22431
commit 61984efaf0
2 changed files with 4 additions and 4 deletions

View File

@@ -149,7 +149,7 @@ end
---Invoke completion
---@param ctx cmp.Context
core.complete = function(ctx)
local callback = vim.schedule_wrap(function()
local callback = function()
local new = context.new(ctx)
if new:changed(new.prev_context) then
core.complete(new)
@@ -157,7 +157,7 @@ core.complete = function(ctx)
core.filter.timeout = 50
core.filter()
end
end)
end
for _, s in ipairs(core.get_sources()) do
s:complete(ctx, callback)
end