refactor: completely moved to setup function (#133)

This commit is contained in:
Hubert Pelczarski 2021-03-25 04:03:43 -07:00 committed by GitHub
parent 7bf5076ece
commit 62c22d0f05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 40 deletions

View File

@ -120,8 +120,8 @@ local function component_loader(component)
-- set custom highlights
if component.color then
component.color_highlight = highlight.create_component_highlight_group(
component.color,
component.component_name, component)
component.color, component.component_name,
component)
end
end
end
@ -299,28 +299,7 @@ local function set_statusline()
end
end
function M.setup(user_config)
if M.options ~= nil or M.sections ~= nil or M.inactive_sections ~= nil or
M.tabline ~= nil or M.extensions ~= nil then
if vim.api.nvim_echo then
vim.api.nvim_echo({
{
'lualine.nvim: lualine is moving to setup function to be consistent with other lua plugins, all other configuration options will be removed by 24.03.2021, please change your configuration(example in readme)',
'WarningMsg'
}
}, true, {})
else
print(
'lualine.nvim: lualine is moving to setup function to be consistent with other lua plugins, all other configuration options will be removed by 24.03.2021, please change your configuration(example in readme)')
end
if M.options ~= nil then user_config.options = M.options end
if M.sections ~= nil then user_config.sections = M.sections end
if M.inactive_sections ~= nil then
user_config.inactive_sections = M.inactive_sections
end
if M.tabline ~= nil then user_config.tabline = M.tabline end
if M.extensions ~= nil then user_config.extensions = M.extensions end
end
local function setup(user_config)
apply_configuration(vim.g.lualine)
apply_configuration(user_config)
check_single_separator()
@ -331,19 +310,4 @@ function M.setup(user_config)
set_tabline()
end
function M.status(user_config)
if vim.api.nvim_echo then
vim.api.nvim_echo({
{
'lualine.nvim: status function has been renamed to setup and will be removed by 24.03.2021, please change your configuration',
'WarningMsg'
}
}, true, {})
else
print(
'lualine.nvim: status function has been renamed to setup and will be removed by 24.03.2021, please change your configuration')
end
return M.setup(user_config)
end
return M
return {setup = setup}