airline#highlighter#exec: do not build cmd always
This commit is contained in:
parent
429cfcd71e
commit
f51f73773d
|
@ -61,16 +61,16 @@ function! airline#highlighter#exec(group, colors)
|
||||||
let colors[2] = s:gui2cui(get(colors, 0, ''), get(colors, 2, ''))
|
let colors[2] = s:gui2cui(get(colors, 0, ''), get(colors, 2, ''))
|
||||||
let colors[3] = s:gui2cui(get(colors, 1, ''), get(colors, 3, ''))
|
let colors[3] = s:gui2cui(get(colors, 1, ''), get(colors, 3, ''))
|
||||||
endif
|
endif
|
||||||
let cmd= printf('hi %s %s %s %s %s %s %s %s',
|
|
||||||
\ a:group, s:Get(colors, 0, 'guifg=', ''), s:Get(colors, 1, 'guibg=', ''),
|
|
||||||
\ s:Get(colors, 2, 'ctermfg=', ''), s:Get(colors, 3, 'ctermbg=', ''),
|
|
||||||
\ s:Get(colors, 4, 'gui=', ''), s:Get(colors, 4, 'cterm=', ''),
|
|
||||||
\ s:Get(colors, 4, 'term=', ''))
|
|
||||||
let old_hi = airline#highlighter#get_highlight(a:group)
|
let old_hi = airline#highlighter#get_highlight(a:group)
|
||||||
if len(colors) == 4
|
if len(colors) == 4
|
||||||
call add(colors, '')
|
call add(colors, '')
|
||||||
endif
|
endif
|
||||||
if old_hi != colors
|
if old_hi != colors
|
||||||
|
let cmd = printf('hi %s %s %s %s %s %s %s %s',
|
||||||
|
\ a:group, s:Get(colors, 0, 'guifg=', ''), s:Get(colors, 1, 'guibg=', ''),
|
||||||
|
\ s:Get(colors, 2, 'ctermfg=', ''), s:Get(colors, 3, 'ctermbg=', ''),
|
||||||
|
\ s:Get(colors, 4, 'gui=', ''), s:Get(colors, 4, 'cterm=', ''),
|
||||||
|
\ s:Get(colors, 4, 'term=', ''))
|
||||||
exe cmd
|
exe cmd
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
Loading…
Reference in New Issue