diff --git a/lua/cmp/utils/keymap.lua b/lua/cmp/utils/keymap.lua index b7d151c37..0fb8692e4 100644 --- a/lua/cmp/utils/keymap.lua +++ b/lua/cmp/utils/keymap.lua @@ -8,7 +8,7 @@ local keymap = {} ---@param keys string ---@return string keymap.t = function(keys) - return (string.gsub(keys, '(<[A-Za-z0-9\\%-%[%]%^@]->)', function(match) + return (string.gsub(keys, '(<[A-Za-z0-9\\%-%[%]%^@;_]->)', function(match) return vim.api.nvim_eval(string.format([["\%s"]], match)) end)) end @@ -17,7 +17,7 @@ end ---@param keys string ---@return string keymap.normalize = vim.fn.has('nvim-0.8') == 1 and function(keys) - local t = string.gsub(keys, '<([A-Za-z0-9\\%-%[%]%^@]-)>', function(match) + local t = string.gsub(keys, '<([A-Za-z0-9\\%-%[%]%^@;_]-)>', function(match) -- Use the \<* notation, which distinguishes from , etc. return vim.api.nvim_eval(string.format([["\<*%s>"]], match)) end) diff --git a/lua/cmp/utils/keymap_spec.lua b/lua/cmp/utils/keymap_spec.lua index 959783f34..9f60e6345 100644 --- a/lua/cmp/utils/keymap_spec.lua +++ b/lua/cmp/utils/keymap_spec.lua @@ -16,6 +16,8 @@ describe('keymap', function() '', '', '', + '', + '', '', '', '(example)',