From 14fd943dc6894c679650d8dd03ce17fe68191309 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 18 Nov 2020 12:09:43 +0100 Subject: [PATCH] highlighter: vim9 script implementation of highlight_modified_inactive --- autoload/airline/highlighter.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/autoload/airline/highlighter.vim b/autoload/airline/highlighter.vim index a1bf53a8..88a1e126 100644 --- a/autoload/airline/highlighter.vim +++ b/autoload/airline/highlighter.vim @@ -522,4 +522,17 @@ else def airline#highlighter#add_accent(accent: string): void # {{{2 s:accents[accent] = 1 enddef + def airline#highlighter#highlight_modified_inactive(bufnr: number): void # {{{2 + var colors: list + if getbufvar(bufnr, '&modified') + colors = exists('g:airline#themes#' .. g:airline_theme .. '#palette.inactive_modified.airline_c') + ? eval('g:airline#themes#' .. g:airline_theme .. '#palette.inactive_modified.airline_c') : [] + else + colors = exists('g:airline#themes#' .. g:airline_theme .. '#palette.inactive.airline_c') + ? eval('g:airline#themes#' .. g:airline_theme .. '#palette.inactive.airline_c') : [] + endif + if !empty(colors) + airline#highlighter#exec('airline_c' .. bufnr .. '_inactive', colors) + endif + enddef endif " }}}1