From 62c22d0f05c79a1bc890b15c1a1a5a0215936e2f Mon Sep 17 00:00:00 2001 From: Hubert Pelczarski <41551030+hoob3rt@users.noreply.github.com> Date: Thu, 25 Mar 2021 04:03:43 -0700 Subject: [PATCH] refactor: completely moved to setup function (#133) --- lua/lualine/init.lua | 44 ++++---------------------------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/lua/lualine/init.lua b/lua/lualine/init.lua index 848d75b..397cfd9 100644 --- a/lua/lualine/init.lua +++ b/lua/lualine/init.lua @@ -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}