fix: make <M-`> work again (#2107)

* fix: make <M-`> work again

* Update keymap_spec.lua

fix typo in keymap_spec.lua
This commit is contained in:
林柏臣
2024-12-20 13:27:07 +08:00
committed by GitHub
parent 8c447245e1
commit b555203ce4
2 changed files with 3 additions and 2 deletions

View File

@@ -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 <C-J> from <NL>, etc.
return vim.api.nvim_eval(string.format([["\<*%s>"]], match))
end)

View File

@@ -23,6 +23,7 @@ describe('keymap', function()
'<C-/>',
'<C-_>',
"<C-'>",
'<M-`>',
'<Tab>',
'<S-Tab>',
'<Plug>(example)',