mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-29 04:00:11 +02:00
fix(cmp): set default group_index to 1 to prevent issues with custom sources
This commit is contained in:
parent
d894556c37
commit
0a05888d99
1 changed files with 14 additions and 6 deletions
|
@ -71,12 +71,13 @@ return {
|
|||
fallback()
|
||||
end,
|
||||
}),
|
||||
sources = {
|
||||
{ name = "nvim_lsp", group_index = 1 },
|
||||
{ name = "luasnip", group_index = 1 },
|
||||
{ name = "buffer", group_index = 2 },
|
||||
{ name = "path", group_index = 2 },
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
}),
|
||||
formatting = {
|
||||
format = function(_, item)
|
||||
local icons = require("lazyvim.config").icons.kinds
|
||||
|
@ -94,6 +95,13 @@ return {
|
|||
sorting = defaults.sorting,
|
||||
}
|
||||
end,
|
||||
---@param opts cmp.ConfigSchema
|
||||
config = function(_, opts)
|
||||
for _, source in ipairs(opts.sources) do
|
||||
source.group_index = source.group_index or 1
|
||||
end
|
||||
require("cmp").setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
-- auto pairs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue