fix(cmp): use better cmp.confirm
This commit is contained in:
@ -36,19 +36,8 @@ return {
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = function(fallback)
|
||||
if cmp.core.view:visible() or vim.fn.pumvisible() == 1 then
|
||||
LazyVim.create_undo()
|
||||
if cmp.confirm({ select = true }) then
|
||||
return
|
||||
end
|
||||
end
|
||||
return fallback()
|
||||
end,
|
||||
["<S-CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<CR>"] = LazyVim.cmp.confirm(),
|
||||
["<S-CR>"] = LazyVim.cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<C-CR>"] = function(fallback)
|
||||
cmp.abort()
|
||||
fallback()
|
||||
|
Reference in New Issue
Block a user