From 62847a8cc95a147ae17dc7f840fc5abc797d8dc9 Mon Sep 17 00:00:00 2001 From: Igbanam Ogbuluijah Date: Wed, 7 Dec 2022 02:28:19 +0000 Subject: [PATCH] add variardic arguments to get_highlight functions --- autoload/airline/highlighter.vim | 3 +-- autoload/airline/themes.vim | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/autoload/airline/highlighter.vim b/autoload/airline/highlighter.vim index a2615799..a9151009 100644 --- a/autoload/airline/highlighter.vim +++ b/autoload/airline/highlighter.vim @@ -430,12 +430,11 @@ else return res enddef - def airline#highlighter#get_highlight2(fg: list, bg: list, rest1: string = '', rest2: string = '', rest3: string = ''): list + def airline#highlighter#get_highlight2(fg: list, bg: list, ...rest: list): list 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 diff --git a/autoload/airline/themes.vim b/autoload/airline/themes.vim index e12f1540..69e096eb 100644 --- a/autoload/airline/themes.vim +++ b/autoload/airline/themes.vim @@ -104,12 +104,12 @@ else return palette enddef - def airline#themes#get_highlight(group: string): list - return call('airline#highlighter#get_highlight', [group]) + def airline#themes#get_highlight(group: string, ...modifiers: list): list + return call('airline#highlighter#get_highlight', [group, modifiers]) enddef - def airline#themes#get_highlight2(fg: list, bg: list): list - return call('airline#highlighter#get_highlight2', [fg, bg]) + def airline#themes#get_highlight2(fg: list, bg: list, ...modifiers: list): list + return call('airline#highlighter#get_highlight2', [fg, bg] + modifiers) enddef def airline#themes#patch(palette: dict): void