[Breaking] Refactor: Removed viml like g:lualine styled config

This was deprecated for a while .
This commit is contained in:
shadmansaleh 2021-08-08 23:44:03 +06:00
parent fac96d71cc
commit 1816bc8622
2 changed files with 5 additions and 21 deletions

View File

@ -41,27 +41,21 @@ local function fix_separators(separators)
end
local function apply_configuration(config_table)
if not config_table then return vim.deepcopy(config) end
local function parse_sections(section_group_name)
if not config_table[section_group_name] then return end
for section_name, section in pairs(config_table[section_group_name]) do
config[section_group_name][section_name] =
vim.deepcopy(config_table[section_group_name][section_name])
if type(section) == 'table' then
for _, component in pairs(config[section_group_name][section_name]) do
if type(component) == 'table' and type(component[2]) == 'table' then
local options = component[2]
component[2] = nil
for key, val in pairs(options) do component[key] = val end
end
end
end
end
end
parse_sections('options')
parse_sections('sections')
parse_sections('inactive_sections')
parse_sections('tabline')
if config_table.extensions then config.extensions = config_table.extensions end
if config_table.extensions then
config.extensions = vim.deepcopy(config_table.extensions)
end
config.options.section_separators = fix_separators(
config.options.section_separators)
config.options.component_separators = fix_separators(

View File

@ -218,17 +218,7 @@ local function setup_augroup()
end
local function setup(user_config)
if user_config then
config = config_module.apply_configuration(user_config)
elseif vim.g.lualine then
vim.schedule(function()
vim.api.nvim_err_writeln(
[[Lualine: lualine will stop supporting vimscript soon, change your config to lua or wrap it around lua << EOF ... EOF]]) -- luacheck: ignore
end)
config = config_module.apply_configuration(vim.g.lualine)
else
config = config_module.apply_configuration({})
end
config = config_module.apply_configuration(user_config)
setup_augroup()
setup_theme()
loader.load_all(config)