Skip to content

Commit

Permalink
fix(cmp): properly set cmp group_index to fix issues with copilot a…
Browse files Browse the repository at this point in the history
…nd other sources (#1639)
  • Loading branch information
folke authored Oct 8, 2023
1 parent 502d324 commit de93848
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
12 changes: 6 additions & 6 deletions lua/lazyvim/plugins/coding.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ return {
select = true,
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
}),
sources = {
{ name = "nvim_lsp", group_index = 1 },
{ name = "luasnip", group_index = 1 },
{ name = "buffer", group_index = 2 },
{ name = "path", group_index = 2 },
},
formatting = {
format = function(_, item)
local icons = require("lazyvim.config").icons.kinds
Expand Down
3 changes: 1 addition & 2 deletions lua/lazyvim/plugins/extras/coding/codeium.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ return {
},
---@param opts cmp.ConfigSchema
opts = function(_, opts)
table.insert(opts.sources, 1, { name = "codeium", group_index = 2 })
table.insert(opts.sources, 1, { name = "codeium", group_index = 1 })
opts.sorting = opts.sorting or require("cmp.config.default")().sorting
end,
},

}
2 changes: 1 addition & 1 deletion lua/lazyvim/plugins/extras/coding/copilot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ return {
},
---@param opts cmp.ConfigSchema
opts = function(_, opts)
table.insert(opts.sources, 1, { name = "copilot", group_index = 2 })
table.insert(opts.sources, 1, { name = "copilot", group_index = 1 })
opts.sorting = opts.sorting or require("cmp.config.default")().sorting
table.insert(opts.sorting.comparators, 1, require("copilot_cmp.comparators").prioritize)
end,
Expand Down

0 comments on commit de93848

Please sign in to comment.