From 40554c80ad1a395bb982808837c1b5861d948709 Mon Sep 17 00:00:00 2001 From: max397574 Date: Fri, 8 Oct 2021 15:08:57 +0200 Subject: [PATCH] fix: new function to check for cmp completitions --- lua/plugins/configs/cmp.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugins/configs/cmp.lua b/lua/plugins/configs/cmp.lua index 7461d78..045a9d9 100644 --- a/lua/plugins/configs/cmp.lua +++ b/lua/plugins/configs/cmp.lua @@ -43,7 +43,7 @@ cmp.setup { select = true, }, [""] = function(fallback) - if vim.fn.pumvisible() == 1 then + if cmp.visible() then vim.fn.feedkeys(vim.api.nvim_replace_termcodes("", true, true, true), "n") elseif require("luasnip").expand_or_jumpable() then vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-expand-or-jump", true, true, true), "") @@ -52,7 +52,7 @@ cmp.setup { end end, [""] = function(fallback) - if vim.fn.pumvisible() == 1 then + if cmp.visible() then vim.fn.feedkeys(vim.api.nvim_replace_termcodes("", true, true, true), "n") elseif require("luasnip").jumpable(-1) then vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-jump-prev", true, true, true), "")