Merge pull request #1634 from Cimbali/master

Fix over-caching of paths
This commit is contained in:
Christian Brabandt 2018-01-15 08:02:09 +01:00 committed by GitHub
commit a3bdb10aea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 13 deletions

View File

@ -15,21 +15,22 @@ else
endif
function! airline#extensions#fugitiveline#bufname()
if exists('b:fugitive_name')
return b:fugitive_name
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())
endif
catch
endtry
endif
let b:fugitive_name = fnamemodify(bufname('%'), s:fmod)
try
let buffer = fugitive#buffer()
if buffer.type('blob')
let b:fugitive_name = fnamemodify(buffer.repo().translate(buffer.path()), s:fmod)
endif
catch
endtry
return b:fugitive_name
if empty(b:fugitive_name)
return fnamemodify(bufname('%'), s:fmod)
else
return fnamemodify(b:fugitive_name, s:fmod)
endif
endfunction
function! airline#extensions#fugitiveline#init(ext)