Add reason to complete function (#529)

fix #528
This commit is contained in:
Lukas Reineke
2021-11-17 01:17:58 +09:00
committed by GitHub
parent 4d800fbcab
commit 17d57f96cc
3 changed files with 14 additions and 6 deletions

View File

@@ -52,8 +52,12 @@ cmp.get_config = function()
end
---Invoke completion manually
cmp.complete = function()
cmp.core:complete(cmp.core:get_context({ reason = cmp.ContextReason.Manual }))
---@param option cmp.ContextOption
cmp.complete = function(option)
option = option or {}
option.reason = option.reason or cmp.ContextReason.Manual
cmp.core:complete(cmp.core:get_context(option))
return true
end