Make sure config is not nil (#836)

This ensures that the config is at least `{}` and never `nil`.
Otherwise, calling `cmp.setup()` errors out.
This commit is contained in:
Nicolas Mattia
2022-03-16 05:42:57 +01:00
committed by GitHub
parent e23de1f2b4
commit c60cb7a100

View File

@@ -157,6 +157,10 @@ end
---@param c cmp.ConfigSchema
---@return cmp.ConfigSchema
config.normalize = function(c)
-- make sure c is not 'nil'
local c = c == nil and {} or c
if c.mapping then
local normalized = {}
for k, v in pairs(c.mapping) do