Merge pull request #1759 from tpope/fugitive-path

Fixes for fugitiveline
This commit is contained in:
Christian Brabandt 2018-07-13 21:22:42 +02:00 committed by GitHub
commit db45cdd994
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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