This commit is contained in:
hrsh7th
2021-08-10 21:41:34 +09:00
parent 22ec3ad442
commit 59a6ee577a
6 changed files with 141 additions and 34 deletions

View File

@@ -153,16 +153,17 @@ end
---Invoke completion
---@param ctx cmp.Context
core.complete = function(ctx)
local callback = vim.schedule_wrap(function()
local new = context.new(ctx)
if new:changed(new.prev_context) then
core.complete(new)
else
core.filter.timeout = 50
core.filter()
end
end)
for _, s in ipairs(core.get_sources()) do
s:complete(ctx, function()
local new = context.new(ctx)
if new:changed(new.prev_context) then
core.complete(new)
else
core.filter.timeout = 50
core.filter()
end
end)
s:complete(ctx, callback)
end
core.filter.timeout = ctx.pumvisible and 50 or 0