Skip to content

Commit

Permalink
Revert "fix: support overwrite when merge config. (#1394)"
Browse files Browse the repository at this point in the history
This reverts commit 7056741.

Sorry for the noise but I'm a lil confused about this new option...? Like idk if
the performance difference between these two is even that big, and maybe it's
not actually working as expected?
  • Loading branch information
Jint-lzxy committed Jan 19, 2025
1 parent a02472d commit 2590529
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
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

0 comments on commit 2590529

Please sign in to comment.