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),
|
["<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", },
|
||||||
|
|||||||
Reference in New Issue
Block a user