From 5391b3e2469b6b786fdef6f1f2e77115209ffe1a Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 18 Nov 2020 11:07:23 +0100 Subject: [PATCH] highlighter: vim9 script implementation of s:exec_separator --- autoload/airline/highlighter.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/autoload/airline/highlighter.vim b/autoload/airline/highlighter.vim index dd38c345..3bf6ebec 100644 --- a/autoload/airline/highlighter.vim +++ b/autoload/airline/highlighter.vim @@ -485,4 +485,20 @@ else endif endif enddef + def s:exec_separator(dict: dict, 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