highlighter: vim9 script implementation of load_theme

This commit is contained in:
Christian 2020-11-18 11:13:16 +01:00 committed by Christian Brabandt
parent 4f8675434a
commit 798a346a91
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -501,4 +501,18 @@ else
dict[group] = colors
airline#highlighter#exec(group, colors)
enddef
def airline#highlighter#load_theme(): void # {{{2
if pumvisible()
return
endif
for winnr in filter(range(1, winnr('$')), {_, v -> v != winnr()})
airline#highlighter#highlight_modified_inactive(winbufnr(winnr))
endfor
airline#highlighter#highlight(['inactive'])
if getbufvar( bufnr('%'), '&modified' )
airline#highlighter#highlight(['normal', 'modified'])
else
airline#highlighter#highlight(['normal'])
endif
enddef
endif