Implement enabled=false configuration

This commit is contained in:
hrsh7th
2021-09-13 00:59:48 +09:00
parent 1cec1ecb31
commit a78894a09a
9 changed files with 69 additions and 48 deletions

View File

@@ -40,6 +40,15 @@ config.get = function()
end)
end
---Return cmp is enabled or not.
config.enabled = function()
local enabled = config.get().enabled
if type(enabled) == 'function' then
return enabled()
end
return not not enabled
end
---Return source config
---@param name string
---@return cmp.SourceConfig