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