migrate config form function to global variable

This commit is contained in:
asep komarudin 2023-03-05 17:34:12 +07:00
parent b6f0601d3d
commit 38d2c29a95
24 changed files with 248 additions and 245 deletions

View file

@ -17,17 +17,17 @@ local function idxOf(array, value)
return nil
end
local data_exists, custom_lsp = pcall(require, "custom.register_lsp")
local data_exists, custom_lsp = pcall(require, "core.config")
if data_exists then
for _, client in pairs(custom_lsp.lspreg) do
for _, client in pairs(custom_lsp.register_lsp) do
table.insert(servers, client)
end
end
local data_ok, unregis = pcall(require, "custom.register_lsp")
local data_ok, unregis = pcall(require, "core.config")
if data_ok then
if unregis.skip_reg ~= nil then
for _, unreg in pairs(custom_lsp.skip_reg) do
if unregis.unregister_lsp ~= nil then
for _, unreg in pairs(custom_lsp.unregister_lsp) do
local my_index = idxOf(servers, unreg)
table.remove(servers, my_index)
end