From 083abe0fbbe6a58de2749e3f22abe721852c0ca7 Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Wed, 18 Oct 2023 05:36:06 +0200 Subject: [PATCH] Fix completion being annoying --- lua/plugins/cmp.lua | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 244dc7a..b212a2b 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -80,7 +80,7 @@ local function setup() [""] = cmp.mapping.scroll_docs(4), [""] = 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", } ), - [""] = cmp.mapping( - function (fallback) - if cmp.visible() then - cmp.select_next_item() - else - fallback() - end - end, { "i", "s", } - ), - [""] = cmp.mapping( - function (fallback) - if cmp.visible() then - cmp.select_prev_item() - else - fallback() - end - end, { "i", "s", } - ), }, sources = { { name = "nvim_lsp", },