From c144543d037a4046b62dba7e80b3e90edb72de6a Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Wed, 4 Sep 2013 15:25:55 +0000 Subject: [PATCH] fixes color change regression. resolves #218. --- autoload/airline.vim | 6 +++++- t/airline.vim | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/autoload/airline.vim b/autoload/airline.vim index 4d1eb78..5d09e47 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -96,6 +96,10 @@ function! s:invoke_funcrefs(context, funcrefs) endfunction function! airline#statusline(winnr) + return '%{airline#check_mode()}'.s:contexts[a:winnr].line +endfunction + +function! airline#check_mode() if get(w:, 'airline_active', 1) let l:m = mode() if l:m ==# "i" @@ -126,6 +130,6 @@ function! airline#statusline(winnr) let w:airline_lastmode = mode_string endif - return s:contexts[a:winnr].line + return '' endfunction diff --git a/t/airline.vim b/t/airline.vim index b523d43..c613ad3 100644 --- a/t/airline.vim +++ b/t/airline.vim @@ -79,5 +79,9 @@ describe 'airline' Expect getwinvar(2, '&statusline') != 'airline#parts#mode' wincmd c end + + it 'should include check_mode' + Expect airline#statusline(1) =~ 'airline#check_mode' + end end