Cache only git calls, not bufname and fnamemodify
This commit is contained in:
parent
18da5aa699
commit
a104e40b10
@ -15,21 +15,22 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
function! airline#extensions#fugitiveline#bufname()
|
function! airline#extensions#fugitiveline#bufname()
|
||||||
if exists('b:fugitive_name')
|
if !exists('b:fugitive_name')
|
||||||
return 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
|
endif
|
||||||
|
|
||||||
let b:fugitive_name = fnamemodify(bufname('%'), s:fmod)
|
if empty(b:fugitive_name)
|
||||||
|
return fnamemodify(bufname('%'), s:fmod)
|
||||||
try
|
else
|
||||||
let buffer = fugitive#buffer()
|
return fnamemodify(b:fugitive_name, s:fmod)
|
||||||
if buffer.type('blob')
|
endif
|
||||||
let b:fugitive_name = fnamemodify(buffer.repo().translate(buffer.path()), s:fmod)
|
|
||||||
endif
|
|
||||||
catch
|
|
||||||
endtry
|
|
||||||
|
|
||||||
return b:fugitive_name
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#extensions#fugitiveline#init(ext)
|
function! airline#extensions#fugitiveline#init(ext)
|
||||||
|
Loading…
Reference in New Issue
Block a user