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:
parent
47c9205127
commit
27b52acee7
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue