Blacklist startify for [noperm]

Startify unfortunately does not set the buftype option, so the
`[noperm]` would be shown, since the buffer is not really a file.
(see mhinz/vim-startify#324)

So allow to blacklist startify from this setting. To do so, the logic
from the tabline extension was refactored out into a separate function
that returns true, if the buffer matches
`g:airline#extensions#tabline#ignore_bufadd_pat` and that function is
then reused for the readonly() function as well.
This commit is contained in:
Christian Brabandt
2018-05-11 22:22:46 +02:00
parent c7e05efb76
commit b84e13f1d7
4 changed files with 16 additions and 4 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ 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)
if !empty(&buftype) || airline#util#ignore_buf(bufname('%'))
return ''
endif
if &readonly && !filereadable(bufname('%'))