introduce new warning section, and refactor whitespace into an extension which uses it

This commit is contained in:
Bailey Ling
2013-08-07 00:17:33 +00:00
parent 4d67c802b3
commit 528f56472c
4 changed files with 18 additions and 3 deletions
@@ -0,0 +1,11 @@
" MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
function! airline#extensions#whitespace#check()
let w:airline_section_warning = '%{get(w:, "airline_active", 0) && search(" $", "nw")'
\ .'? " ".g:airline_whitespace_symbol." " : ""}'
endfunction
function! airline#extensions#whitespace#init(ext)
call a:ext.add_statusline_funcref(function('airline#extensions#whitespace#check'))
endfunction