Fix completion being annoying

This commit is contained in:
2023-10-18 05:36:06 +02:00
parent 410622c1f7
commit 083abe0fbb
+1 -19
View File
@@ -80,7 +80,7 @@ local function setup()
["<C-f>"] = cmp.mapping.scroll_docs(4), ["<C-f>"] = cmp.mapping.scroll_docs(4),
["<CR>"] = cmp.mapping( ["<CR>"] = cmp.mapping(
function (fallback) function (fallback)
if cmp.visible() then if cmp.visible() and cmp.get_selected_entry() then
cmp.confirm( cmp.confirm(
{ {
behavior = cmp.ConfirmBehavior.Replace, behavior = cmp.ConfirmBehavior.Replace,
@@ -116,24 +116,6 @@ local function setup()
end end
end, { "i", "s", } end, { "i", "s", }
), ),
["<Down>"] = cmp.mapping(
function (fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end, { "i", "s", }
),
["<Up>"] = cmp.mapping(
function (fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { "i", "s", }
),
}, },
sources = { sources = {
{ name = "nvim_lsp", }, { name = "nvim_lsp", },