highlight: correctly cache and restore reverse attributes for highlighting colors
references #1779
This commit is contained in:
parent
7e004804d1
commit
726b730f0a
@ -53,15 +53,16 @@ function! airline#highlighter#reset_hlcache()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#highlighter#get_highlight(group, ...)
|
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)
|
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
|
else
|
||||||
let fg = s:get_syn(a:group, 'fg')
|
let fg = s:get_syn(a:group, 'fg')
|
||||||
let bg = s:get_syn(a:group, 'bg')
|
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 bold = synIDattr(synIDtrans(hlID(a:group)), 'bold')
|
||||||
let opts = a:000
|
let opts = a:000
|
||||||
if bold
|
if bold
|
||||||
@ -165,9 +166,9 @@ function! s:exec_separator(dict, from, to, inverse, suffix)
|
|||||||
if pumvisible()
|
if pumvisible()
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
let group = a:from.'_to_'.a:to.a:suffix
|
||||||
let l:from = airline#themes#get_highlight(a:from.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 l:to = airline#themes#get_highlight(a:to.a:suffix)
|
||||||
let group = a:from.'_to_'.a:to.a:suffix
|
|
||||||
if a:inverse
|
if a:inverse
|
||||||
let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ]
|
let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ]
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user