This commit is contained in:
hrsh7th
2022-01-11 18:47:21 +09:00
parent 96c392dee3
commit 5ddf3732c5
2 changed files with 2 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ local keymap = {}
---@param keys string ---@param keys string
---@return string ---@return string
keymap.t = function(keys) 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)) return vim.api.nvim_eval(string.format([["\%s"]], match))
end)) end))
end end

View File

@@ -14,6 +14,7 @@ describe('keymap', function()
'<C-[>', '<C-[>',
'<C-^>', '<C-^>',
'<C-@>', '<C-@>',
'<C-\\>',
'<Tab>', '<Tab>',
'<Plug>(example)', '<Plug>(example)',
'<C-r>="abc"<CR>', '<C-r>="abc"<CR>',