From 9bee0e923e90bbc264b040ec08e21e9f02d8e3d7 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 27 Jun 2018 18:07:59 -0400 Subject: [PATCH] Use FugitivePath in fugitiveline if available --- autoload/airline/extensions/fugitiveline.vim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/autoload/airline/extensions/fugitiveline.vim b/autoload/airline/extensions/fugitiveline.vim index e161817..4b72218 100644 --- a/autoload/airline/extensions/fugitiveline.vim +++ b/autoload/airline/extensions/fugitiveline.vim @@ -18,9 +18,13 @@ function! airline#extensions#fugitiveline#bufname() if !exists('b:fugitive_name') let b:fugitive_name = '' try - let buffer = fugitive#buffer() - if buffer.type('blob') - let b:fugitive_name = buffer.repo().translate(buffer.path('/')) + if bufname('%') =~? '^fugitive:' && exists('*FugitivePath') + let b:fugitive_name = FugitivePath() + elseif exists('b:git_dir') + let buffer = fugitive#buffer() + if buffer.type('blob') + let b:fugitive_name = buffer.repo().translate(buffer.path('/')) + endif endif catch endtry