From 3968bea5e2cf7096cb0823e9dcb8f0b9c23dcce1 Mon Sep 17 00:00:00 2001 From: hrsh7th Date: Tue, 9 Nov 2021 14:11:51 +0900 Subject: [PATCH] Fixes the bug that the `cmp.close` does not close the menu when using native_menu. --- lua/cmp/view/native_entries_view.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/cmp/view/native_entries_view.lua b/lua/cmp/view/native_entries_view.lua index 0198f48..a922271 100644 --- a/lua/cmp/view/native_entries_view.lua +++ b/lua/cmp/view/native_entries_view.lua @@ -78,7 +78,8 @@ end native_entries_view.close = function(self) if api.is_suitable_mode() then - vim.api.nvim_select_popupmenu_item(-1, false, false, {}) + vim.fn.complete(1, {}) + vim.api.nvim_select_popupmenu_item(-1, false, true, {}) end self.offset = -1 self.entries = {}