From 429cfcd71e1103057f6500ed8e3c10a3868117c2 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 6 Jun 2016 20:40:51 +0200 Subject: [PATCH 1/2] minor: do not copy args in s:get_array --- autoload/airline/highlighter.vim | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/autoload/airline/highlighter.vim b/autoload/airline/highlighter.vim index 3d30d69e..f575b5f1 100644 --- a/autoload/airline/highlighter.vim +++ b/autoload/airline/highlighter.vim @@ -31,11 +31,9 @@ function! s:get_syn(group, what) endfunction function! s:get_array(fg, bg, opts) - let fg = a:fg - let bg = a:bg return g:airline_gui_mode ==# 'gui' - \ ? [ fg, bg, '', '', join(a:opts, ',') ] - \ : [ '', '', fg, bg, join(a:opts, ',') ] + \ ? [ a:fg, a:bg, '', '', join(a:opts, ',') ] + \ : [ '', '', a:fg, a:bg, join(a:opts, ',') ] endfunction function! airline#highlighter#get_highlight(group, ...) From f51f73773d0fce088c390c1485765abe7921fdbd Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 6 Jun 2016 20:41:33 +0200 Subject: [PATCH 2/2] airline#highlighter#exec: do not build cmd always --- autoload/airline/highlighter.vim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/autoload/airline/highlighter.vim b/autoload/airline/highlighter.vim index f575b5f1..02dbc3b3 100644 --- a/autoload/airline/highlighter.vim +++ b/autoload/airline/highlighter.vim @@ -61,16 +61,16 @@ function! airline#highlighter#exec(group, colors) let colors[2] = s:gui2cui(get(colors, 0, ''), get(colors, 2, '')) let colors[3] = s:gui2cui(get(colors, 1, ''), get(colors, 3, '')) 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) if len(colors) == 4 call add(colors, '') endif 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 endif endfunction