The action can be function or table...(I want to normalize it...Hm...)

This commit is contained in:
hrsh7th
2021-08-17 23:51:56 +09:00
parent 24158a72b2
commit f12fd73f11

View File

@@ -74,9 +74,13 @@ end
core.on_keymap = function(keys, fallback)
for key, action in pairs(config.get().mapping) do
if key == keys then
if type(action) == 'function' then
return action(core, fallback)
else
return action.invoke(core, fallback)
end
end
end
--Commit character. NOTE: This has a lot of cmp specific implementation to make more user-friendly.
local chars = keymap.t(keys)