@@ -13,9 +13,10 @@ mapping = setmetatable({}, {
|
||||
})
|
||||
|
||||
---Invoke completion
|
||||
mapping.complete = function()
|
||||
---@param option cmp.ContextOption
|
||||
mapping.complete = function(option)
|
||||
return function(fallback)
|
||||
if not require('cmp').complete() then
|
||||
if not require('cmp').complete(option) then
|
||||
fallback()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user