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

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: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() function! s:check_mixed_indent()
if s:indent_algo == 0 if s:indent_algo == 0
@ -80,6 +80,14 @@ function! airline#extensions#whitespace#toggle()
call airline#extensions#whitespace#init() call airline#extensions#whitespace#init()
let s:enabled = 1 let s:enabled = 1
endif 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') echo 'Whitespace checking: '.(s:enabled ? 'Enabled' : 'Disabled')
endfunction endfunction