From a65e0827c163c88da72b7f25092c70401eee66b5 Mon Sep 17 00:00:00 2001 From: Simi Falaye Date: Thu, 19 Sep 2024 14:40:05 -0600 Subject: [PATCH] fix: stop luarocks server list from being overwritten --- lua/rocks/config/internal.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/rocks/config/internal.lua b/lua/rocks/config/internal.lua index 2d8bf6d..decf619 100644 --- a/lua/rocks/config/internal.lua +++ b/lua/rocks/config/internal.lua @@ -94,14 +94,16 @@ local default_config = { ---@return server_url[] get_servers = function() local luarocks_opts = config.get_rocks_toml().luarocks + -- WARNING: Return a copy of the constant table so it can't be modified by the caller return luarocks_opts and type(luarocks_opts.servers) == "table" and luarocks_opts.servers - or constants.DEFAULT_ROCKS_SERVERS + or vim.deepcopy(constants.DEFAULT_ROCKS_SERVERS) end, ---@return server_url[] get_dev_servers = function() local luarocks_opts = config.get_rocks_toml().luarocks + -- WARNING: Return a copy of the constant table so it can't be modified by the caller return luarocks_opts and type(luarocks_opts.dev_servers) == "table" and luarocks_opts.dev_servers - or constants.DEFAULT_DEV_SERVERS + or vim.deepcopy(constants.DEFAULT_DEV_SERVERS) end, ---@return server_url[] get_all_servers = function()