From 05d89420f027d0e6a8c81e1a8c5ff35289b48d17 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Tue, 12 Oct 2021 14:00:47 +0200 Subject: [PATCH] fix: nvim-cmp config fix [Tab] behavior --- .config/nvim/lua/plugin/cmp.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/nvim/lua/plugin/cmp.lua b/.config/nvim/lua/plugin/cmp.lua index deebb51..fee7dda 100644 --- a/.config/nvim/lua/plugin/cmp.lua +++ b/.config/nvim/lua/plugin/cmp.lua @@ -58,8 +58,8 @@ cmp.setup { select = true, }), [""] = cmp.mapping(function(fallback) - if vim.fn.pumvisible() == 1 then - vim.fn.feedkeys(t "", "n") + if cmp.visible() then + cmp.select_next_item() elseif luasnip.expand_or_jumpable() then luasnip.expand_or_jump() elseif check_backspace() then @@ -69,8 +69,8 @@ cmp.setup { end end, { "i", "s" }), [""] = cmp.mapping(function(fallback) - if vim.fn.pumvisible() == 1 then - vim.fn.feedkeys(t "", "n") + if cmp.visible() then + cmp.select_prev_item() elseif luasnip.jumpable(-1) then luasnip.jump(-1) else