highlighter: vim9 script implementation of get_highlight2

This commit is contained in:
Christian 2020-11-18 09:03:36 +01:00 committed by Christian Brabandt
parent 19861861fd
commit 0238d386bb
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -386,4 +386,12 @@ else
s:hl_groups[group] = res
return res
enddef
def airline#highlighter#get_highlight2(fg: list<string>, bg: list<string>, rest1: string = '', rest2: string = '', rest3: string = ''): list<string> # {{{2
var guifg = s:get_syn(fg[0], fg[1], 'gui')
var guibg = s:get_syn(bg[0], bg[1], 'gui')
var ctermfg = s:get_syn(fg[0], fg[1], 'cterm')
var ctermbg = s:get_syn(bg[0], bg[1], 'cterm')
var rest = [ rest1, rest2, rest3 ]
return s:get_array(guifg, guibg, ctermfg, ctermbg, filter(rest, {_, v -> !empty(v)}))
enddef
endif