Merge pull request #493 from chrisbra/master

Enable :AirlineToggleWhitespace,
This commit is contained in:
Bailey Ling 2014-04-20 10:05:36 -04:00
commit 7560204212
1 changed files with 9 additions and 1 deletions

View File

@ -19,7 +19,7 @@ let s:indent_algo = get(g:, 'airline#extensions#whitespace#mixed_indent_algo', 0
let s:max_lines = get(g:, 'airline#extensions#whitespace#max_lines', 20000)
let s:enabled = 1
let s:enabled = get(g:, 'airline#extensions#whitespace#enabled', 1)
function! s:check_mixed_indent()
if s:indent_algo == 0
@ -80,6 +80,14 @@ function! airline#extensions#whitespace#toggle()
call airline#extensions#whitespace#init()
let s:enabled = 1
endif
if exists("g:airline#extensions#whitespace#enabled")
let g:airline#extensions#whitespace#enabled = s:enabled
if s:enabled
let g:airline_section_warning = airline#section#create(['syntastic', 'eclim', 'whitespace'])
call airline#update_statusline()
call airline#extensions#whitespace#init()
endif
endif
echo 'Whitespace checking: '.(s:enabled ? 'Enabled' : 'Disabled')
endfunction