fix: only access mapping_info.opts field if possible

This commit is contained in:
Leon Heidelbach 2022-07-12 18:34:22 +02:00
parent 5339bc42ae
commit 7b683eaf63

View file

@ -90,7 +90,10 @@ M.load_mappings = function(mappings, mapping_opt)
-- merge default + user opts -- merge default + user opts
local default_opts = merge_tb("force", { mode = mode }, mapping_opt or {}) local default_opts = merge_tb("force", { mode = mode }, mapping_opt or {})
local opts = merge_tb("force", default_opts, mapping_info.opts or {}) local opts = merge_tb("force", default_opts, mapping_info.opts or {})
if mapping_info.opts then
mapping_info.opts = nil mapping_info.opts = nil
end
set_maps(keybind, mapping_info, opts) set_maps(keybind, mapping_info, opts)
end end