Fix completion being annoying
This commit is contained in:
+1
-19
@@ -80,7 +80,7 @@ local function setup()
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<CR>"] = cmp.mapping(
|
||||
function (fallback)
|
||||
if cmp.visible() then
|
||||
if cmp.visible() and cmp.get_selected_entry() then
|
||||
cmp.confirm(
|
||||
{
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
@@ -116,24 +116,6 @@ local function setup()
|
||||
end
|
||||
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 = {
|
||||
{ name = "nvim_lsp", },
|
||||
|
||||
Reference in New Issue
Block a user