Announcement: Breaking changes
hrsh7th opened this issue · comments
hrsh7th commented
Announcement: Breaking changes
hrsh7th commented
Use floating window instead of native menu #224
The user must change the configuration as the following.
Change feeding <C-n>
/<C-p>
and vim.fn.pumvisible() ==
check
You should change the configuration.
cmp.setup {
mapping = {
['<Tab>'] = function(fallback)
if vim.fn.pumvisible() == 1 then
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<C-n>', true, true, true), true)
else
fallback()
end
end
}
}
↓↓↓
cmp.setup {
mapping = {
['<Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end
}
}
hrsh7th commented
SourceConfig.opts is deprecated #561
cmp.setup {
sources = {
{
name = 'buffer',
opts = {
get_bufnrs = function() return { vim.api.nvim_get_current_buf() } end
}
}
}
}
↓↓↓
cmp.setup {
sources = {
{
name = 'buffer',
option = {
get_bufnrs = function() return { vim.api.nvim_get_current_buf() } end
}
}
}
}
hrsh7th commented
The cmp.complete
arguments was changed
cmp.setup {
mapping = {
['<C-x><C-s>'] = cmp.mapping.complete({
sources = {
{ name = 'vsnip' }
}
}),
}
}
↓↓↓
cmp.setup {
mapping = {
['<C-x><C-s>'] = cmp.mapping.complete({
config = {
sources = {
{ name = 'vsnip' }
}
}
}),
}
}
hrsh7th commented
The cmp#ready
autocmd renamed to CmpReady
autocmd User cmp#ready ...
↓↓↓
autocmd User CmpReady ...
hrsh7th commented
Remove experimental.native_menu
and add view.entries = 'native'
instead.
cmp.setup {
...
experimental = {
native_menu = true
}
...
}
↓↓↓
cmp.setup {
...
view = {
entries = 'native'
}
...
}
hrsh7th commented
Remove documentation
and add window.documentation
instead.
cmp.setup {
...
documentation = false,
...
}
↓↓↓
cmp.setup {
...
window = {
documentation = false,
}
...
}
NOTE: I'm planning the window
configuration option will be deprecated. I think it should be merged to view
configuration option.
hrsh7th commented
Remove all default key mappings (workaround is existing)
All key mappings have been removed by 93cf84f.
If you want to achieve the previous behavior, you can use the built-in helper as below.
cmp.setup {
...
mapping = cmp.mapping.preset.insert({
-- Your configuration here.
})
...
}
cmp.setup.cmdline {
...
mapping = cmp.mapping.preset.cmdline({
-- Your configuration here.
})
...
}
hrsh7th commented
hrsh7th commented
source[n].max_item_count is removed
This is minor breaking change.
The source[n].max_item_count
is now removed.
Now performance.max_view_entries
can be used for performance.