branch: fugitive renamed its functions

this caused that the branch extension was not correctly working anymore
because of a refactoring of fugitive tpope/vim-fugitive@5d11ff7

Solution: Move the existence check for the fugitive plugin into a
separate function and call it from there in all places that check the
fugitive plugin. Do the same for lawrencium and vcscommand check.

fixes #605 #1739
This commit is contained in:
Christian Brabandt
2018-06-04 17:31:13 +02:00
parent 08570b6dcb
commit 30a3c4f549
4 changed files with 27 additions and 22 deletions

View File

@@ -103,3 +103,19 @@ function! airline#util#ignore_buf(name)
\ 'gundo|undotree|vimfiler|tagbar|nerd_tree|startify')
return match(a:name, pat) > -1
endfunction
function! airline#util#has_fugitive()
return exists('*fugitive#head') || exists('*FugitiveHead')
endfunction
function! airline#util#has_lawrencium()
return exists('*lawrencium#statusline')
endfunction
function! airline#util#has_vcscommand()
return get(g:, 'airline#extensions#branch#use_vcscommand', 0) && exists('*VCSCommandGetStatusLine')
endfunction
function! airline#util#has_custom_scm()
return !empty(get(g:, 'airline#extensions#branch#custom_head', ''))
endfunction