highlighter: skip create hi groups for inactive mode if not needed
This will skip creation of highlighting groups, if there are no inactive windows.
This commit is contained in:
parent
560092a9ec
commit
583ae3d5f9
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user