From c7e05efb767e7bf6f2738ab452f54442c0ccb3bb Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Fri, 11 May 2018 09:50:13 +0200 Subject: [PATCH] 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). --- autoload/airline/parts.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/autoload/airline/parts.vim b/autoload/airline/parts.vim index da7eef6..e6146ce 100644 --- a/autoload/airline/parts.vim +++ b/autoload/airline/parts.vim @@ -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