Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: some symbols can't be mapped correctly #2081

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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