From dd9e1b7bf091a3575ee6d6ecb4465f3eba4bfd82 Mon Sep 17 00:00:00 2001 From: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com> Date: Thu, 26 Aug 2021 20:29:25 +0600 Subject: [PATCH] fix: Section seperator disapearing when x section is empty closes #22 --- lua/lualine/init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/lualine/init.lua b/lua/lualine/init.lua index 12a237a..68697e1 100644 --- a/lua/lualine/init.lua +++ b/lua/lualine/init.lua @@ -76,7 +76,13 @@ local function apply_transitional_separators(status) copied_pos = str_checked elseif next_char == '%' then str_checked = str_checked + 2 -- Skip the following % too - elseif next_char == '=' then + elseif next_char == '=' and last_hl and + (last_hl:find('^lualine_a') or last_hl:find('^lualine_b')) then + -- TODO: Fix this properly + -- This check for lualine_a and lualine_b is dumb. It doesn't garantee + -- c or x section isn't present. Worst case sinario after this patch + -- we have another visual bug that occurs less frequently. + -- Annoying Edge Cases............................................ last_hl = nil str_checked = str_checked + 1 -- Skip the following % too else