highlighter: vim9 script implementation of s:exec_separator

This commit is contained in:
Christian 2020-11-18 11:07:23 +01:00 committed by Christian Brabandt
parent 7310ca6cbf
commit 5391b3e246
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -485,4 +485,20 @@ else
endif
endif
enddef
def s:exec_separator(dict: dict<string>, from: string, to: string, inverse: bool, suffix: string): void # {{{2
if pumvisible()
return
endif
var group = from .. '_to_' .. to .. suffix
var from = airline#themes#get_highlight(from .. suffix)
var colors = []
var to = airline#themes#get_highlight(to .. suffix)
if inverse
colors = [ from[1], to[1], from[3], to[3] ]
else
colors = [ to[1], from[1], to[3], from[3] ]
endif
dict[group] = colors
airline#highlighter#exec(group, colors)
enddef
endif