From c436592559bc8bd50d387bc93aa5fb10a39db8d6 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Tue, 20 Jun 2017 13:58:39 +0200 Subject: [PATCH] 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 --- autoload/airline/extensions/bufferline.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/autoload/airline/extensions/bufferline.vim b/autoload/airline/extensions/bufferline.vim index 8ca825f4..f2bfbbbb 100644 --- a/autoload/airline/extensions/bufferline.vim +++ b/autoload/airline/extensions/bufferline.vim @@ -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 -