From 49de058222f725c33a23aec989013783f3077c53 Mon Sep 17 00:00:00 2001 From: hrsh7th Date: Tue, 14 Dec 2021 13:59:03 +0900 Subject: [PATCH] Fix #637 --- lua/cmp/utils/keymap.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/cmp/utils/keymap.lua b/lua/cmp/utils/keymap.lua index 7716d04..6f403f0 100644 --- a/lua/cmp/utils/keymap.lua +++ b/lua/cmp/utils/keymap.lua @@ -176,7 +176,9 @@ keymap.evacuate = function(bufnr, mode, lhs) if not map.noremap and map.expr then -- remap & expr mapping should evacuate as mapping with solving recursive mapping. rhs = function() - return keymap.t(keymap.recursive(bufnr, mode, lhs, vim.api.nvim_eval(map.rhs))) + -- Feed new key sequence to expand recursive mapping. + vim.api.nvim_feedkeys(keymap.t(keymap.recursive(bufnr, mode, lhs, vim.api.nvim_eval(map.rhs))), 'i', true) + return keymap.t('') end elseif map.noremap and map.expr then -- noremap & expr mapping should always evacuate as mapping.