Add the b:airline_whitespace_disabled feature.

If the per-buffer variable b:airline_whitespace_disabled is defined
and non-zero, whitespace checking will be disabled for that buffer.
This commit is contained in:
Michael Henry 2016-05-14 15:56:48 -04:00
parent ba94fa12b9
commit e67b2847ea
2 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,7 @@ endfunction
function! airline#extensions#whitespace#check() function! airline#extensions#whitespace#check()
if &readonly || !&modifiable || !s:enabled || line('$') > s:max_lines if &readonly || !&modifiable || !s:enabled || line('$') > s:max_lines
\ || get(b:, 'airline_whitespace_disabled', 0)
return '' return ''
endif endif

View File

@ -502,6 +502,15 @@ eclim <https://eclim.org>
matters for mix-indent-file algorithm: > matters for mix-indent-file algorithm: >
let airline#extensions#c_like_langs = ['c', 'cpp', 'cuda', 'javascript', 'ld', 'php'] let airline#extensions#c_like_langs = ['c', 'cpp', 'cuda', 'javascript', 'ld', 'php']
< <
* disable whitespace checking for an individual buffer >
" Checking is enabled by default because b:airline_whitespace_disabled
" is by default not defined:
unlet b:airline_whitespace_disabled
" If b:airline_whitespace_disabled is defined and is non-zero for a buffer,
" then whitespace checking will be disabled for that buffer; for example:
" let b:airline_whitespace_disabled = 1
<
------------------------------------- *airline-tabline* ------------------------------------- *airline-tabline*
Note: If you're using the ctrlspace tabline only the option marked with (c) Note: If you're using the ctrlspace tabline only the option marked with (c)
are supported! are supported!