mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-27 07:54:44 +02:00
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
|
endfunction
|
||||||
|
|
||||||
function! airline#extensions#dirvish#apply(...) abort
|
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_a = 'Dirvish'
|
||||||
|
|
||||||
let w:airline_section_b = exists('*airline#extensions#branch#get_head')
|
let w:airline_section_b = exists('*airline#extensions#branch#get_head')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user