fix(util): on_key compat with Neovim 0.9

This commit is contained in:
Folke Lemaitre 2024-12-15 08:36:11 +01:00
parent 3d67bda1e2
commit effa885120
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -227,8 +227,8 @@ function M.on_key(key, cb)
keys[code] = keys[code] or {}
table.insert(keys[code], cb)
on_key_ns = on_key_ns
or vim.on_key(function(_, typed)
for _, c in ipairs(keys[typed] or {}) do
or vim.on_key(function(resolved, typed)
for _, c in ipairs(keys[typed or resolved] or {}) do
pcall(c, typed)
end
end)