Skip to content

Commit

Permalink
fix: make <c-;> work again (#2073)
Browse files Browse the repository at this point in the history
* fix: make <c-;> work again

* fix: also <c-_>
  • Loading branch information
phanen authored Nov 2, 2024
1 parent 29fb485 commit 7d40510
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/cmp/utils/keymap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions lua/cmp/utils/keymap_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ describe('keymap', function()
'<C-^>',
'<C-@>',
'<C-\\>',
'<C-;>',
'<C-_>',
'<Tab>',
'<S-Tab>',
'<Plug>(example)',
Expand Down

0 comments on commit 7d40510

Please sign in to comment.