From 9c07c2d1c5581b22f742b891cadd42a311c1cf96 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Mon, 20 Dec 2021 07:54:16 +0200 Subject: [PATCH] Fix vim.fn.complete being constantly called (#654) --- lua/cmp/view/native_entries_view.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/cmp/view/native_entries_view.lua b/lua/cmp/view/native_entries_view.lua index 1ffbe40..a74f697 100644 --- a/lua/cmp/view/native_entries_view.lua +++ b/lua/cmp/view/native_entries_view.lua @@ -77,7 +77,7 @@ native_entries_view.open = function(self, offset, entries) end native_entries_view.close = function(self) - if api.is_suitable_mode() then + if api.is_suitable_mode() and self:visible() then vim.fn.complete(1, {}) vim.api.nvim_select_popupmenu_item(-1, false, true, {}) end