From 81c2dc1f9d662bf7ec113dd5182dfd42853b860c Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Thu, 4 Jul 2013 14:01:14 -0400 Subject: [PATCH] fix the lazyredraw requirement --- README.md | 4 ---- plugin/airline.vim | 29 +++++++++++++---------------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 558dc783..67cb2810 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,6 @@ i wrote the initial version on an airplane, and since it's light as air it turne `:help airline` -# prerequisites - -for this plugin to work properly `lazyredraw` needs to be set. during development i had this on the entire time, and it turns out that this has a major impact in colors being able to change prompty (ironic that lazy == eager here). i'm still tracking down the cause and hopefully in the future this requirement can be removed. - # faq/troubleshooting 1. the powerline font symbols are not showing up diff --git a/plugin/airline.vim b/plugin/airline.vim index 9b04bad0..2d26b9ad 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -3,9 +3,6 @@ if &cp || v:version < 702 || (exists('g:loaded_airline') && g:loaded_airline) finish endif let g:loaded_airline = 1 -if !&lazyredraw - echom 'for the time being, vim-airline needs lazyredraw enabled to work properly.' -endif function! s:check_defined(variable, default) if !exists(a:variable) let {a:variable} = a:default @@ -37,13 +34,13 @@ call s:check_defined('g:airline_mode_map', { \ '' : 'V-BLCK', \ }) let s:airline_highlight_map = { - \ 'mode' : 'User2', - \ 'mode_separator' : 'User3', - \ 'info' : 'User4', - \ 'info_separator' : 'User5', - \ 'statusline' : 'User6', - \ 'file' : 'User8', - \ 'inactive' : 'User9', + \ 'mode' : 'Al2', + \ 'mode_separator' : 'Al3', + \ 'info' : 'Al4', + \ 'info_separator' : 'Al5', + \ 'statusline' : 'Al6', + \ 'file' : 'Al8', + \ 'inactive' : 'Al9', \ } let s:airline_highlight_groups = keys(s:airline_highlight_map) @@ -102,12 +99,12 @@ function! s:update_statusline(active) endif call s:update_externals() - let l:mode_color = a:active ? "%2*" : "%9*" - let l:mode_sep_color = a:active ? "%3*" : "%9*" - let l:info_color = a:active ? "%4*" : "%9*" - let l:info_sep_color = a:active ? "%5*" : "%9*" - let l:status_color = a:active ? "%6*" : "%9*" - let l:file_flag_color = a:active ? "%8*" : "%9*" + let l:mode_color = a:active ? "%#Al2#" : "%#Al9#" + let l:mode_sep_color = a:active ? "%#Al3#" : "%#Al9#" + let l:info_color = a:active ? "%#Al4#" : "%#Al9#" + let l:info_sep_color = a:active ? "%#Al5#" : "%#Al9#" + let l:status_color = a:active ? "%#Al6#" : "%#Al9#" + let l:file_flag_color = a:active ? "%#Al7#" : "%#Al9#" let sl = l:mode_color let sl.= a:active