From 28bebd35ea018a639c1d434945811cebb14bd9bf Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Wed, 24 Apr 2019 15:48:16 +0200 Subject: [PATCH] fugitiveline: use correct fugitive functions --- autoload/airline/extensions/fugitiveline.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/fugitiveline.vim b/autoload/airline/extensions/fugitiveline.vim index 1dfbb24..8f8c1d0 100644 --- a/autoload/airline/extensions/fugitiveline.vim +++ b/autoload/airline/extensions/fugitiveline.vim @@ -17,7 +17,11 @@ function! airline#extensions#fugitiveline#bufname() try if bufname('%') =~? '^fugitive:' && exists('*FugitiveReal') let b:fugitive_name = FugitiveReal(bufname('%')) - elseif exists('b:git_dir') + elseif exists('b:git_dir') && exists('*fugitive#repo') + if get(b:, 'fugitive_type', '') is# 'blob' + let b:fugitive_name = fugitive#repo().translate(FugitivePath(@%, '')) + endif + elseif exists('b:git_dir') && !exists('*fugitive#repo') let buffer = fugitive#buffer() if buffer.type('blob') let b:fugitive_name = buffer.repo().translate(buffer.path('/'))