Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix: support overwrite when merge config. (#1394)" #1404

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/modules/configs/ui/edgy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ return function()
filter = trouble_filter("right"),
},
},
}, false, nil, true)
})
end
9 changes: 2 additions & 7 deletions lua/modules/utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,7 @@ end
---@param opts nil|table @The default config to be merged with
---@param vim_plugin? boolean @If this plugin is written in vimscript or not
---@param setup_callback? function @Add new callback if the plugin needs unusual setup function
---@param overwrite? boolean @If load user table-type config by overwriting
function M.load_plugin(plugin_name, opts, vim_plugin, setup_callback, overwrite)
function M.load_plugin(plugin_name, opts, vim_plugin, setup_callback)
vim_plugin = vim_plugin or false

-- Get the file name of the default config
Expand Down Expand Up @@ -331,11 +330,7 @@ function M.load_plugin(plugin_name, opts, vim_plugin, setup_callback, overwrite)
if ok then
-- Extend base config if the returned user config is a table
if type(user_config) == "table" then
if overwrite == true then
opts = vim.tbl_deep_extend("force", opts, user_config)
else
opts = tbl_recursive_merge(opts, user_config)
end
opts = tbl_recursive_merge(opts, user_config)
setup_callback(opts)
-- Replace base config if the returned user config is a function
elseif type(user_config) == "function" then
Expand Down
Loading