-
Notifications
You must be signed in to change notification settings - Fork 400
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
perf: use builtin for key normalization #1935
Conversation
thank you. |
Hi @tomtomjhj @hrsh7th This seems breaks keybind for To reproduce what I am facing, with the config below vim.api.nvim_set_keymap('i', '<c-j>', '<cmd>echo "Hello"<cr>', {})
local cmp_select_next_item = function(fallback)
if cmp.visible() then
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
else
fallback()
end
end
cmp.setup({
mapping = cmp.mapping.preset.insert({
['<C-j>'] = cmp.mapping(cmp_select_next_item),
... Even the cmp menu is opened, it still prints I have removed my keybind to Thank you for your work on this plugin btw! |
Thta seems to be nvim bug. reported neovim/neovim#30887 |
After this commit, I'm seeing a slight delay when typing |
After #986, @zeertzjq added the
keytrans()
function for translating byte rep of keys to key notation form in neovim/neovim@907fc8a. This can be used for normalization.This reduces running time of
prepare()
from about 16ms to 6ms on my setup.btw I' curious about why
keymap.t
manually replaces<
instead of usingnvim_replace_termcodes
(f2f6dce).nvim_replace_termcodes
is slightly faster.