Skip to content

Commit

Permalink
refactor: remove custom table merge function
Browse files Browse the repository at this point in the history
  • Loading branch information
iabdelkareem committed Feb 14, 2024
1 parent 026e316 commit 4d23e97
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions lua/csharp/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,7 @@ local default_config = {
---@param user_config table
---@return table
local function merge(default_config, user_config)
local config = {}

for key, default_value in pairs(default_config) do
local user_value = user_config[key]

if user_value == nil then
config[key] = default_value
elseif type(user_value) ~= type(default_value) then
config[key] = default_value
elseif type(user_value) == "table" then
config[key] = merge(default_value, user_value)
else
config[key] = user_value
end
end

return config
return vim.tbl_deep_extend("force", default_config, user_config)
end

function M.get_defaults()
Expand Down

0 comments on commit 4d23e97

Please sign in to comment.