From e3bb39106e2c236a3e04044b7d8ae6ac93af709b Mon Sep 17 00:00:00 2001 From: Zhong Jianxin Date: Thu, 15 Jun 2023 10:33:01 +0800 Subject: [PATCH] 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 dab9171e6426b6eb8f0f8bcd0829a0415d260fcb Fix #1961 #2025 * clean up! --------- Co-authored-by: siduck --- lua/core/default_config.lua | 2 +- lua/core/utils.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index a151df5..639916a 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -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.mappings = {} +M.mappings = require "core.mappings" return M diff --git a/lua/core/utils.lua b/lua/core/utils.lua index 4c44dc6..8b2a03d 100644 --- a/lua/core/utils.lua +++ b/lua/core/utils.lua @@ -8,11 +8,11 @@ M.load_config = function() if chadrc_path then 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.mappings.disabled = nil end - config.mappings.disabled = nil return config end