Only attempt to use dirvish if b:dirvish exists

This was causing persistent errors when you run, for example,

```
ls | nvim -c 'setf dirvish'
```

as dirvish will not yet have set that local variable yet airline will
attempt to use it.
This commit is contained in:
Nathan Lanza 2020-09-11 23:28:25 -04:00 committed by Christian Brabandt
parent 47c9205127
commit 27b52acee7
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ function! airline#extensions#dirvish#init(ext) abort
endfunction
function! airline#extensions#dirvish#apply(...) abort
if &filetype ==# 'dirvish'
if &filetype ==# 'dirvish' && exists('b:dirvish')
let w:airline_section_a = 'Dirvish'
let w:airline_section_b = exists('*airline#extensions#branch#get_head')