Fix default mappings not load if chadrc.lua does not exist (#2037)

* Fix default mappings not load if chadrc.lua does not exist

The regression was introduced by dab9171e64

Fix #1961 #2025

* clean up!

---------

Co-authored-by: siduck <siduck@tutanota.com>
This commit is contained in:
Zhong Jianxin 2023-06-15 10:33:01 +08:00 committed by GitHub
parent a18d92dfa6
commit e3bb39106e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -87,6 +87,6 @@ M.plugins = "" -- path i.e "custom.plugins", so make custom/plugins.lua file
M.lazy_nvim = require "plugins.configs.lazy_nvim" -- config for lazy.nvim startup options M.lazy_nvim = require "plugins.configs.lazy_nvim" -- config for lazy.nvim startup options
M.mappings = {} M.mappings = require "core.mappings"
return M return M

View file

@ -8,11 +8,11 @@ M.load_config = function()
if chadrc_path then if chadrc_path then
local chadrc = dofile(chadrc_path) local chadrc = dofile(chadrc_path)
config.mappings = M.remove_disabled_keys(chadrc.mappings, require "core.mappings") config.mappings = M.remove_disabled_keys(chadrc.mappings, config.mappings)
config = merge_tb("force", config, chadrc) config = merge_tb("force", config, chadrc)
config.mappings.disabled = nil
end end
config.mappings.disabled = nil
return config return config
end end