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'.
This commit is contained in:
shadmansaleh 2021-08-30 09:45:42 +06:00
parent 649b7dd652
commit 114a840a41
1 changed files with 3 additions and 2 deletions

View File

@ -29,9 +29,10 @@ end
-- Helper for apply_transitional_separators() -- Helper for apply_transitional_separators()
local function fill_section_separator(status, str_checked, last_hl, sep, reverse) local function fill_section_separator(status, str_checked, last_hl, sep, reverse)
-- Inserts transitional separator along with transitional highlight -- 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) 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 local transitional_highlight = reverse -- lua ternary assignment x ? y : z
and modules.highlight.get_transitional_highlights(last_hl, next_hl) and modules.highlight.get_transitional_highlights(last_hl, next_hl)
or modules.highlight.get_transitional_highlights(next_hl, last_hl) or modules.highlight.get_transitional_highlights(next_hl, last_hl)