Squashed commit of the following:
commit 6e81cce2cf9b9487e92c15cdfb145647de7c2db5 Author: hrsh7th <629908+hrsh7th@users.noreply.github.com> Date: Thu Apr 27 01:11:41 2023 +0900 Improve key identity check
This commit is contained in:
@@ -20,7 +20,7 @@ keymap.normalize = function(keys)
|
||||
local normalize_buf = buffer.ensure('cmp.util.keymap.normalize')
|
||||
vim.api.nvim_buf_set_keymap(normalize_buf, 't', keys, '<Plug>(cmp.utils.keymap.normalize)', {})
|
||||
for _, map in ipairs(vim.api.nvim_buf_get_keymap(normalize_buf, 't')) do
|
||||
if keymap.equals(map.rhs, '<Plug>(cmp.utils.keymap.normalize)') then
|
||||
if keymap.t(map.rhs) == keymap.t('<Plug>(cmp.utils.keymap.normalize)') then
|
||||
vim.api.nvim_buf_del_keymap(normalize_buf, 't', keys)
|
||||
return map.lhs
|
||||
end
|
||||
@@ -110,7 +110,7 @@ end
|
||||
---@param b string
|
||||
---@return boolean
|
||||
keymap.equals = function(a, b)
|
||||
return keymap.t(a) == keymap.t(b)
|
||||
return keymap.normalize(a) == keymap.normalize(b)
|
||||
end
|
||||
|
||||
---Register keypress handler.
|
||||
|
||||
Reference in New Issue
Block a user