fugitive: mark fugitive like buffers with "[git]"

closes #1852
This commit is contained in:
Christian Brabandt
2019-02-02 18:04:53 +01:00
parent dc7d991007
commit 54584a2bb2
2 changed files with 7 additions and 3 deletions

View File

@@ -8,7 +8,8 @@ if !airline#util#has_fugitive()
endif
if exists("+autochdir") && &autochdir == 1
let s:has_autochdir = exists("+autochdir") && &autochdir
if s:has_autochdir
let s:fmod = ':p'
else
let s:fmod = ':.'
@@ -33,12 +34,12 @@ function! airline#extensions#fugitiveline#bufname()
if empty(b:fugitive_name)
return fnamemodify(bufname('%'), s:fmod)
else
return fnamemodify(b:fugitive_name, s:fmod)
return fnamemodify(b:fugitive_name, s:fmod). " [git]"
endif
endfunction
function! airline#extensions#fugitiveline#init(ext)
if exists("+autochdir") && &autochdir == 1
if s:has_autochdir
" if 'acd' is set, vim-airline uses the path section, so we need to redefine this here as well
call airline#parts#define_raw('path', '%<%{airline#extensions#fugitiveline#bufname()}%m')
else