diff --git a/lua/lualine.lua b/lua/lualine.lua index 85d3e48..84af95d 100644 --- a/lua/lualine.lua +++ b/lua/lualine.lua @@ -139,7 +139,7 @@ local function statusline(sections, is_focused) if #section_data > 0 then if not applied_midsection_devider and section_name > 'c' then applied_midsection_devider = true - section_data = '%=' .. section_data + section_data = '%#' .. modules.highlight.append_mode 'lualine_c' .. '#%=' .. section_data end if not applied_trunc and section_name > 'b' then applied_trunc = true diff --git a/lua/lualine/extensions/fugitive.lua b/lua/lualine/extensions/fugitive.lua index 2cb48e0..6e75e40 100644 --- a/lua/lualine/extensions/fugitive.lua +++ b/lua/lualine/extensions/fugitive.lua @@ -6,16 +6,9 @@ local function fugitive_branch() local icon = '' -- e0a0 return icon .. ' ' .. vim.fn.FugitiveHead() end -local empty = { - function() - return ' ' - end, - padding = 0, -} M.sections = { lualine_a = { fugitive_branch }, - lualine_c = { empty }, lualine_z = { 'location' }, } diff --git a/lua/lualine/extensions/fzf.lua b/lua/lualine/extensions/fzf.lua index dd57775..4afda21 100644 --- a/lua/lualine/extensions/fzf.lua +++ b/lua/lualine/extensions/fzf.lua @@ -3,18 +3,11 @@ local function fzf_statusline() return 'FZF' end -local empty = { - function() - return ' ' - end, - padding = 0, -} local M = {} M.sections = { lualine_a = { fzf_statusline }, - lualine_c = { empty }, } M.filetypes = { 'fzf' } diff --git a/lua/lualine/extensions/nerdtree.lua b/lua/lualine/extensions/nerdtree.lua index 6cda624..27b117b 100644 --- a/lua/lualine/extensions/nerdtree.lua +++ b/lua/lualine/extensions/nerdtree.lua @@ -3,18 +3,11 @@ local function get_short_cwd() return vim.fn.fnamemodify(vim.fn.getcwd(), ':~') end -local empty = { - function() - return ' ' - end, - padding = 0, -} local M = {} M.sections = { lualine_a = { get_short_cwd }, - lualine_c = { empty }, } M.filetypes = { 'nerdtree' } diff --git a/lua/lualine/extensions/quickfix.lua b/lua/lualine/extensions/quickfix.lua index 6045714..05cced5 100644 --- a/lua/lualine/extensions/quickfix.lua +++ b/lua/lualine/extensions/quickfix.lua @@ -15,12 +15,6 @@ local function title() end return vim.fn.getqflist({ title = 0 }).title end -local empty = { - function() - return ' ' - end, - padding = 0, -} local M = {} @@ -32,7 +26,6 @@ end M.sections = { lualine_a = { label }, lualine_b = { title }, - lualine_c = { empty }, lualine_z = { 'location' }, } diff --git a/lua/lualine/extensions/toggleterm.lua b/lua/lualine/extensions/toggleterm.lua index c603806..a9be001 100644 --- a/lua/lualine/extensions/toggleterm.lua +++ b/lua/lualine/extensions/toggleterm.lua @@ -4,18 +4,11 @@ local function toggleterm_statusline() return 'ToggleTerm #' .. vim.b.toggle_number end -local empty = { - function() - return ' ' - end, - padding = 0, -} local M = {} M.sections = { lualine_a = { toggleterm_statusline }, - lualine_c = { empty }, } M.filetypes = { 'toggleterm' } diff --git a/lua/lualine/highlight.lua b/lua/lualine/highlight.lua index 445e12e..a64d8c4 100644 --- a/lua/lualine/highlight.lua +++ b/lua/lualine/highlight.lua @@ -90,7 +90,7 @@ end -- @description: adds '_mode' at end of highlight_group -- @param highlight_group:(string) name of highlight group -- @return: (string) highlight group name with mode -local function append_mode(highlight_group) +function M.append_mode(highlight_group) local mode = require('lualine.utils.mode').get_mode() if mode == 'VISUAL' @@ -218,7 +218,7 @@ function M.component_format_highlight(highlight_name) return '%#' .. highlight_group .. '#' end if modules.utils.is_focused() then - highlight_group = append_mode(highlight_group) + highlight_group = M.append_mode(highlight_group) else highlight_group = highlight_group .. '_inactive' end @@ -237,7 +237,7 @@ function M.format_highlight(is_focused, highlight_group) if not is_focused then highlight_name = highlight_group .. [[_inactive]] else - highlight_name = append_mode(highlight_group) + highlight_name = M.append_mode(highlight_group) end if M.highlight_exists(highlight_name) then return '%#' .. highlight_name .. '#'