From 583ae3d5f96f91abb37467028eed1a39302a819f Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Mon, 26 Jun 2017 22:30:48 +0200 Subject: [PATCH] highlighter: skip create hi groups for inactive mode if not needed This will skip creation of highlighting groups, if there are no inactive windows. --- autoload/airline/highlighter.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/airline/highlighter.vim b/autoload/airline/highlighter.vim index 456e8d9..631f311 100644 --- a/autoload/airline/highlighter.vim +++ b/autoload/airline/highlighter.vim @@ -202,6 +202,11 @@ function! airline#highlighter#highlight(modes, ...) let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val') let suffix = a:modes[0] == 'inactive' ? '_inactive' : '' for mode in mapped + if mode == 'inactive' && winnr('$') == 1 + " there exist no inactive windows, don't need to create all those + " highlighting groups + continue + endif if exists('g:airline#themes#{g:airline_theme}#palette[mode]') let dict = g:airline#themes#{g:airline_theme}#palette[mode] for kvp in items(dict) @@ -239,4 +244,3 @@ function! airline#highlighter#highlight(modes, ...) endif endfor endfunction -