remove the need to copy to a local variable

This commit is contained in:
Bailey Ling 2013-07-03 21:13:34 +00:00
parent 091b152105
commit 3324d54898
1 changed files with 3 additions and 7 deletions

View File

@ -26,11 +26,7 @@ call s:check_defined('g:airline_exclude_filetypes', ['qf','netrw','diff','undotr
set laststatus=2 set laststatus=2
let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running') let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running')
let s:load_the_theme = g:airline#themes#{g:airline_theme}#normal
for mode in ['normal','insert','visual']
let s:airline_colors_{mode} = g:airline#themes#{g:airline_theme}#{mode}
let s:airline_colors_{mode}_modified = g:airline#themes#{g:airline_theme}#{mode}_modified
endfor
let s:airline_mode_map = { let s:airline_mode_map = {
\ 'n' : ' NORMAL ', \ 'n' : ' NORMAL ',
@ -55,8 +51,8 @@ let s:airline_highlight_groups = keys(s:airline_highlight_map)
function! s:highlight(mode) function! s:highlight(mode)
for key in s:airline_highlight_groups for key in s:airline_highlight_groups
if exists('s:airline_colors_{a:mode}[key]') if exists('g:airline#themes#{g:airline_theme}#{a:mode}[key]')
let colors = s:airline_colors_{a:mode}[key] let colors = g:airline#themes#{g:airline_theme}#{a:mode}[key]
if s:is_win32term if s:is_win32term
let colors = map(colors, 'v:val != "" && v:val > 128 ? v:val - 128 : v:val') let colors = map(colors, 'v:val != "" && v:val > 128 ? v:val - 128 : v:val')
endif endif