From 775a371660d66deec95a86010d7d0ae413b21f74 Mon Sep 17 00:00:00 2001 From: hrsh7th Date: Tue, 19 Oct 2021 14:47:41 +0900 Subject: [PATCH] Fix #375 --- lua/cmp/core.lua | 2 +- lua/cmp/utils/keymap.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/cmp/core.lua b/lua/cmp/core.lua index bae5545..9abb327 100644 --- a/lua/cmp/core.lua +++ b/lua/cmp/core.lua @@ -311,7 +311,7 @@ core.confirm = function(self, e, option, callback) local confirm = {} table.insert(confirm, keymap.backspace(ctx.cursor.character - misc.to_utfindex(e.context.cursor_before_line, e:get_offset()))) table.insert(confirm, e:get_word()) - keymap.feedkeys(table.concat(confirm, ''), 'n', function() + keymap.feedkeys(table.concat(confirm, ''), 'nt', function() -- Restore to the requested state. local restore = {} table.insert(restore, keymap.backspace(vim.str_utfindex(e:get_word()))) diff --git a/lua/cmp/utils/keymap.lua b/lua/cmp/utils/keymap.lua index d2bdb30..ae19550 100644 --- a/lua/cmp/utils/keymap.lua +++ b/lua/cmp/utils/keymap.lua @@ -260,7 +260,7 @@ misc.set(_G, { 'cmp', 'utils', 'keymap', 'listen', 'run' }, function(id) definition.callback( definition.keys, misc.once(function() - vim.api.nvim_feedkeys(keymap.t(definition.fallback), 'i', true) + vim.api.nvim_feedkeys(keymap.t(definition.fallback), 'it', true) end) ) return keymap.t('')