add variardic arguments to get_highlight functions

This commit is contained in:
Igbanam Ogbuluijah 2022-12-07 02:28:19 +00:00
parent 25d53a80f4
commit 62847a8cc9
No known key found for this signature in database
GPG Key ID: 77DA74C380932B57
2 changed files with 5 additions and 6 deletions

View File

@ -430,12 +430,11 @@ else
return res
enddef
def airline#highlighter#get_highlight2(fg: list<string>, bg: list<string>, rest1: string = '', rest2: string = '', rest3: string = ''): list<string>
def airline#highlighter#get_highlight2(fg: list<string>, bg: list<string>, ...rest: list<string>): list<string>
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

View File

@ -104,12 +104,12 @@ else
return palette
enddef
def airline#themes#get_highlight(group: string): list<string>
return call('airline#highlighter#get_highlight', [group])
def airline#themes#get_highlight(group: string, ...modifiers: list<string>): list<string>
return call('airline#highlighter#get_highlight', [group, modifiers])
enddef
def airline#themes#get_highlight2(fg: list<string>, bg: list<string>): list<string>
return call('airline#highlighter#get_highlight2', [fg, bg])
def airline#themes#get_highlight2(fg: list<string>, bg: list<string>, ...modifiers: list<string>): list<string>
return call('airline#highlighter#get_highlight2', [fg, bg] + modifiers)
enddef
def airline#themes#patch(palette: dict<any>): void