Format with stylua

This commit is contained in:
hrsh7th
2024-11-21 08:40:20 +00:00
committed by github-actions[bot]
parent 6fade6db39
commit 2d7e6da1ec
2 changed files with 3 additions and 3 deletions

View File

@@ -8,7 +8,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
@@ -17,7 +17,7 @@ end
---@param keys string ---@param keys string
---@return string ---@return string
keymap.normalize = vim.fn.has('nvim-0.8') == 1 and function(keys) 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. -- Use the \<* notation, which distinguishes <C-J> from <NL>, etc.
return vim.api.nvim_eval(string.format([["\<*%s>"]], match)) return vim.api.nvim_eval(string.format([["\<*%s>"]], match))
end) end)

View File

@@ -20,7 +20,7 @@ describe('keymap', function()
'<C-,>', '<C-,>',
'<C-:>', '<C-:>',
'<C-_>', '<C-_>',
'<C-\'>', "<C-'>",
'<Tab>', '<Tab>',
'<S-Tab>', '<S-Tab>',
'<Plug>(example)', '<Plug>(example)',