Only consider regular files for the '[noperm]'
Recently, NERDTree added the &readonly setting to its buffer. Unfortunately, this caused airline to render the '[noperm]' string in it. Fix this by only making the readonly check for buffers that actually represent files (e.g. the buftype option is empty).
This commit is contained in:
parent
5a065e8b82
commit
c7e05efb76
@ -86,6 +86,11 @@ function! airline#parts#iminsert()
|
||||
endfunction
|
||||
|
||||
function! airline#parts#readonly()
|
||||
" only consider regular buffers (e.g. ones that represent actual files,
|
||||
" but not special ones like e.g. NERDTree)
|
||||
if !empty(&buftype)
|
||||
return ''
|
||||
endif
|
||||
if &readonly && !filereadable(bufname('%'))
|
||||
return '[noperm]'
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user