Fix #456
This commit is contained in:
@@ -74,21 +74,16 @@ end
|
||||
---@param name string
|
||||
---@return cmp.SourceConfig
|
||||
config.get_source_config = function(name)
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
local global = config.global
|
||||
local buffer = config.buffers[bufnr] or { revision = 1 }
|
||||
return config.cache:ensure({ 'get_source_config', bufnr, global.revision or 0, buffer.revision or 0, name }, function()
|
||||
local c = config.get()
|
||||
for _, s in ipairs(c.sources) do
|
||||
if s.name == name then
|
||||
if type(s.opts) ~= 'table' then
|
||||
s.opts = {}
|
||||
end
|
||||
return s
|
||||
local c = config.get()
|
||||
for _, s in ipairs(c.sources) do
|
||||
if s.name == name then
|
||||
if type(s.opts) ~= 'table' then
|
||||
s.opts = {}
|
||||
end
|
||||
return s
|
||||
end
|
||||
return nil
|
||||
end)
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
---Normalize mapping key
|
||||
|
||||
Reference in New Issue
Block a user