diff --git a/autoload/airline/highlighter.vim b/autoload/airline/highlighter.vim index 2b898c3..6080987 100644 --- a/autoload/airline/highlighter.vim +++ b/autoload/airline/highlighter.vim @@ -53,15 +53,16 @@ function! airline#highlighter#reset_hlcache() endfunction function! airline#highlighter#get_highlight(group, ...) + let reverse = g:airline_gui_mode ==# 'gui' + \ ? synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'gui') + \ : synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm') + \|| synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'term') if get(g:, 'airline_highlighting_cache', 0) && has_key(s:hl_groups, a:group) - return s:hl_groups[a:group] + let res = s:hl_groups[a:group] + return reverse ? [ res[1], res[0], res[3], res[2], res[4] ] : res else let fg = s:get_syn(a:group, 'fg') let bg = s:get_syn(a:group, 'bg') - let reverse = g:airline_gui_mode ==# 'gui' - \ ? synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'gui') - \ : synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm') - \|| synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'term') let bold = synIDattr(synIDtrans(hlID(a:group)), 'bold') let opts = a:000 if bold @@ -165,9 +166,9 @@ function! s:exec_separator(dict, from, to, inverse, suffix) if pumvisible() return endif + let group = a:from.'_to_'.a:to.a:suffix let l:from = airline#themes#get_highlight(a:from.a:suffix) let l:to = airline#themes#get_highlight(a:to.a:suffix) - let group = a:from.'_to_'.a:to.a:suffix if a:inverse let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ] else