bufferline: take 'acd' into account

vim-airline does use a different section (path/file) depending on
whether 'acd' is set. Later in the bufferline extesion however, it
unconditionally overwrites the 'file' section, regardless of whether
this section is actually used.

Therefore the bufferline section needs to check this option as well.

fixes #1487
This commit is contained in:
Christian Brabandt 2017-06-20 13:58:39 +02:00
parent e16ff7cc88
commit c436592559
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -20,6 +20,10 @@ function! airline#extensions#bufferline#init(ext)
let g:bufferline_separator = g:airline_symbols.space
endif
call airline#parts#define_raw('file', '%{bufferline#refresh_status()}'.bufferline#get_status_string())
if exists("+autochdir") && &autochdir == 1
" if 'acd' is set, vim-airline uses the path section, so we need ot redefine this here as well
call airline#parts#define_raw('path', '%{bufferline#refresh_status()}'.bufferline#get_status_string())
else
call airline#parts#define_raw('file', '%{bufferline#refresh_status()}'.bufferline#get_status_string())
endif
endfunction