allow warning section to be overwritten (#136).

This commit is contained in:
Bailey Ling 2013-08-20 15:02:17 +00:00
parent e2a758e309
commit cbb9bea9db
3 changed files with 13 additions and 10 deletions

View File

@ -153,18 +153,20 @@ function! airline#extensions#load()
call airline#extensions#branch#init(s:ext)
endif
if (get(g:, 'airline#extensions#syntastic#enabled', 1) && get(g:, 'airline_enable_syntastic', 1))
\ && exists(':SyntasticCheck')
call airline#extensions#syntastic#init(s:ext)
endif
if (get(g:, 'airline#extensions#bufferline#enabled', 1) && get(g:, 'airline_enable_bufferline', 1))
\ && exists('*bufferline#get_status_string')
call airline#extensions#bufferline#init(s:ext)
endif
if (get(g:, 'airline#extensions#whitespace#enabled', 1) && get(g:, 'airline_detect_whitespace', 1))
call airline#extensions#whitespace#init()
if g:airline_section_warning == '__'
if (get(g:, 'airline#extensions#syntastic#enabled', 1) && get(g:, 'airline_enable_syntastic', 1))
\ && exists(':SyntasticCheck')
call airline#extensions#syntastic#init(s:ext)
endif
if (get(g:, 'airline#extensions#whitespace#enabled', 1) && get(g:, 'airline_detect_whitespace', 1))
call airline#extensions#whitespace#init()
endif
endif
if get(g:, 'airline#extensions#readonly#enabled', 1)

View File

@ -1,10 +1,11 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
" vim: et ts=2 sts=2 sw=2
function! airline#extensions#syntastic#apply()
let w:airline_section_warning = ' %#warningmsg#%{SyntasticStatuslineFlag()}'
let w:airline_section_warning = ' %{SyntasticStatuslineFlag()}'
endfunction
function! airline#extensions#syntastic#init(ext)
call a:ext.add_statusline_funcref(function('airline#extensions#syntastic#apply'))
endfunction

View File

@ -56,7 +56,7 @@ call s:check_defined('g:airline_section_gutter', '%=')
call s:check_defined('g:airline_section_x', "%{strlen(&filetype)>0?&filetype:''}")
call s:check_defined('g:airline_section_y', "%{strlen(&fenc)>0?&fenc:''}%{strlen(&ff)>0?'['.&ff.']':''}")
call s:check_defined('g:airline_section_z', '%3p%% '.g:airline_linecolumn_prefix.'%3l:%3c')
call s:check_defined('g:airline_section_warning', '')
call s:check_defined('g:airline_section_warning', '__')
let s:airline_initialized = 0
let s:airline_theme_defined = 0