From 519a2df1a0b02a698e59655b9c992d3bf6dc1686 Mon Sep 17 00:00:00 2001 From: siduck Date: Tue, 28 Jun 2022 11:11:11 +0530 Subject: [PATCH] clean up --- lua/core/utils.lua | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lua/core/utils.lua b/lua/core/utils.lua index 2b3fea0..92e5100 100644 --- a/lua/core/utils.lua +++ b/lua/core/utils.lua @@ -144,19 +144,12 @@ M.merge_plugins = function(default_plugins) return final_table end + M.load_override = function(default_table, plugin_name) - local user_table = M.load_config().plugins.override[plugin_name] + local user_table = M.load_config().plugins.override[plugin_name] or {} + user_table = type(user_table) == "table" and user_table or user_table() - if type(user_table) == "function" then - user_table = user_table() - end - if type(user_table) == "table" then - default_table = merge_tb("force", default_table, user_table) - else - default_table = default_table - end - - return default_table + return user_table and merge_tb("force", default_table, user_table) end M.packer_sync = function(...)