diff --git a/autoload/airline.vim b/autoload/airline.vim index 6def0bf4..81d02c0b 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -106,10 +106,10 @@ function! s:get_statusline(winnr, active) let sl.=l:mode_color let sl.=s:get_section(a:winnr, 'z') - " if a:active - " let warngroup = airline#themes#exec_highlight_separator('Al2', 'warningmsg') - " let sl.='%(%#'.warngroup.'#'.g:airline_right_sep.'%#warningmsg#'.s:getwinvar(a:winnr, 'airline_section_warning', '').'%)' - " endif + if a:active + let warngroup = airline#themes#exec_highlight_separator('Al2', 'warningmsg') + let sl.='%(%#'.warngroup.'#'.g:airline_right_sep.'%#warningmsg#'.s:getwinvar(a:winnr, 'airline_section_warning', '').'%)' + endif endif return sl endfunction diff --git a/autoload/airline/themes.vim b/autoload/airline/themes.vim index 31d42444..ec3e1697 100644 --- a/autoload/airline/themes.vim +++ b/autoload/airline/themes.vim @@ -49,9 +49,6 @@ function! airline#themes#exec_highlight_separator(from, to) let l:from = airline#themes#get_highlight(a:from) let l:to = airline#themes#get_highlight(a:to) let group = a:from.'_to_'.a:to - exec printf('highlight %s guifg=%s guibg=%s ctermfg=%s ctermbg=%s', - \ group, - \ l:to[1], l:from[1], - \ l:to[3], l:from[3]) + call airline#exec_highlight(group, [ l:to[1], l:from[1], l:to[3], l:from[3] ]) return group endfunction