From 66b0736fd4f20c04e48dd6fc61566f696c567443 Mon Sep 17 00:00:00 2001 From: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com> Date: Thu, 5 Aug 2021 21:44:22 +0600 Subject: [PATCH] fix: left section separator not displayed when component begins with a custom highlight --- lua/lualine/utils/section.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/lualine/utils/section.lua b/lua/lualine/utils/section.lua index 00e7721..5bfb04f 100644 --- a/lua/lualine/utils/section.lua +++ b/lua/lualine/utils/section.lua @@ -70,9 +70,11 @@ function M.draw_section(section, section_name, is_focused) -- Remove empty strings from status status = utils.list_shrink(status) local status_str = table.concat(status) - if status_str:find('%%#.*#') == 1 or #status_str == 0 then + + if #status_str == 0 then return '' + elseif status_str:find('%%#.*#') == 1 then -- Don't prepend with old highlight when the component changes it imidiately - return status_str + return left_sparator_string .. status_str else return left_sparator_string .. highlight_name .. status_str end