feat: only confirm autocomplete with enter if item selected
This commit is contained in:
parent
fde2607ca2
commit
415fcc08ae
@ -22,9 +22,15 @@ cmp.setup({
|
||||
{ name = "calc" }
|
||||
}),
|
||||
mapping = {
|
||||
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(),
|
||||
{ 'i', 'c' }),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(),
|
||||
{ "i", "c" }),
|
||||
["<CR>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() and cmp.get_selected_entry() then
|
||||
cmp.confirm()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
|
Reference in New Issue
Block a user