From 114a840a419e41963d80382df222ce5308a5a0f3 Mon Sep 17 00:00:00 2001 From: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com> Date: Mon, 30 Aug 2021 09:45:42 +0600 Subject: [PATCH] enhace: Allow transitional hl to be applied at begining and end of stl Since for left sep at left most location we will not find and prev_hl We will use 'Normal' for right sep of right most position we will not find a next_hl we will use 'Normal'. --- lua/lualine/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/lualine/init.lua b/lua/lualine/init.lua index 14f6157..400c803 100644 --- a/lua/lualine/init.lua +++ b/lua/lualine/init.lua @@ -29,9 +29,10 @@ end -- Helper for apply_transitional_separators() local function fill_section_separator(status, str_checked, last_hl, sep, reverse) -- Inserts transitional separator along with transitional highlight - if last_hl and #last_hl == 0 then return end local next_hl = find_next_hl(status, str_checked) - if next_hl == nil then return end + if last_hl == nil then last_hl = 'Normal' end + if next_hl == nil then next_hl = 'Normal' end + if #next_hl == 0 or #last_hl == 0 then return end local transitional_highlight = reverse -- lua ternary assignment x ? y : z and modules.highlight.get_transitional_highlights(last_hl, next_hl) or modules.highlight.get_transitional_highlights(next_hl, last_hl)