From b0ea537173b55a5d40a971c5094aad2543b17916 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Wed, 3 Jul 2013 03:12:12 +0000 Subject: [PATCH] minor performance tweaks (#11) --- plugin/airline.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/airline.vim b/plugin/airline.vim index 9155bba..10cce05 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -22,6 +22,8 @@ call s:check_defined('g:airline_exclude_filetypes', ['qf','netrw','diff','undotr set laststatus=2 +let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running') + 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 @@ -53,9 +55,9 @@ function! s:highlight(mode, keys) let l:mode .= '_modified' endif for key in a:keys - if exists('s:airline_colors_{l:mode}') && exists('s:airline_colors_{l:mode}[key]') + if exists('s:airline_colors_{l:mode}[key]') let colors = s:airline_colors_{l:mode}[key] - if (has('win32') || has('win64')) && !has('gui_running') + if s:is_win32term let colors = map(colors, 'v:val != "" && v:val > 128 ? v:val - 128 : v:val') endif let cmd = printf('hi %s %s %s %s %s %s %s',