mirror of
https://github.com/vim-airline/vim-airline-themes.git
synced 2024-12-12 21:33:41 +08:00
exclude readonly files from whitespace checking
This commit is contained in:
parent
6ced8b8ce6
commit
f440ad3509
|
@ -4,6 +4,10 @@
|
||||||
" http://got-ravings.blogspot.com/2008/10/vim-pr0n-statusline-whitespace-flags.html
|
" http://got-ravings.blogspot.com/2008/10/vim-pr0n-statusline-whitespace-flags.html
|
||||||
|
|
||||||
function! airline#extensions#whitespace#check()
|
function! airline#extensions#whitespace#check()
|
||||||
|
if &readonly
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('b:airline_whitespace_check')
|
if !exists('b:airline_whitespace_check')
|
||||||
let b:airline_whitespace_check = ''
|
let b:airline_whitespace_check = ''
|
||||||
let trailing = search(' $', 'nw')
|
let trailing = search(' $', 'nw')
|
||||||
|
@ -13,7 +17,7 @@ function! airline#extensions#whitespace#check()
|
||||||
let b:airline_whitespace_check = g:airline_whitespace_symbol." "
|
let b:airline_whitespace_check = g:airline_whitespace_symbol." "
|
||||||
if g:airline_detect_whitespace == 1
|
if g:airline_detect_whitespace == 1
|
||||||
if trailing != 0
|
if trailing != 0
|
||||||
let b:airline_whitespace_check .= 'trailing['.trailing.']'
|
let b:airline_whitespace_check .= 'trailing['.trailing.'] '
|
||||||
endif
|
endif
|
||||||
if mixed
|
if mixed
|
||||||
let b:airline_whitespace_check .= 'mixed-indent '
|
let b:airline_whitespace_check .= 'mixed-indent '
|
||||||
|
|
Loading…
Reference in New Issue
Block a user