Fix key checking
This commit is contained in:
@@ -52,8 +52,10 @@ end
|
|||||||
keymap.feedkeys = setmetatable({
|
keymap.feedkeys = setmetatable({
|
||||||
callbacks = {},
|
callbacks = {},
|
||||||
}, {
|
}, {
|
||||||
__call = function(self, keys, mode, callback)
|
__call = function(self, keys, mode, callback)
|
||||||
|
if #keys ~= 0 then
|
||||||
vim.fn.feedkeys(keymap.t(keys), mode)
|
vim.fn.feedkeys(keymap.t(keys), mode)
|
||||||
|
end
|
||||||
|
|
||||||
if callback then
|
if callback then
|
||||||
local current_mode = string.sub(vim.api.nvim_get_mode().mode, 1, 1)
|
local current_mode = string.sub(vim.api.nvim_get_mode().mode, 1, 1)
|
||||||
@@ -102,7 +104,7 @@ keymap.listen = setmetatable({
|
|||||||
if existing then
|
if existing then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
if map.lhs == keys then
|
if keymap.t(map.lhs) == keymap.t(keys) then
|
||||||
existing = map
|
existing = map
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -110,7 +112,7 @@ keymap.listen = setmetatable({
|
|||||||
if existing then
|
if existing then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
if map.lhs == keys then
|
if keymap.t(map.lhs) == keymap.t(keys) then
|
||||||
existing = map
|
existing = map
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user