fugitiveline: use correct fugitive functions

This commit is contained in:
Christian Brabandt 2019-04-24 15:48:16 +02:00
parent 3ac318bfd3
commit 28bebd35ea
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -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('/'))