Enable :AirlineToggleWhitespace,

even if g:airline#extensions#whitespace#enabled is disabled
This commit is contained in:
Christian Brabandt 2014-04-20 00:39:43 +02:00
parent fafb9ea76e
commit 931367d9fb

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