-
I don't understand how pre-selection works in It seems the For example: Notice how the LSP source got selected first. This doesn't seem to change whether the This is how I configured my sources: sources = cmp.config.sources({
{ name = 'luasnip' },
{ name = 'nvim_lsp' },
{ name = 'nvim_lua' },
{ name = 'calc' },
{ name = 'path' },
{
name = 'spell',
option = {
keep_all_entries = true,
},
},
}, {
{
name = 'buffer',
option = {
get_bufnrs = function()
local bufs = {}
for _, win in ipairs(vim.api.nvim_list_wins()) do
bufs[vim.api.nvim_win_get_buf(win)] = true
end
return vim.tbl_keys(bufs)
end,
},
},
}),
}) |
Beta Was this translation helpful? Give feedback.
Answered by
itaranto
Feb 8, 2024
Replies: 1 comment 2 replies
-
Source priority exists. https://github.com/hrsh7th/nvim-cmp/blob/main/doc/cmp.txt#L609C72-L609C80 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Resolved here: #1670 (reply in thread)