From 981b83003f9ae0f57967fdd7b910420efaa91bf8 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Mon, 4 Jun 2018 18:32:30 +0200 Subject: [PATCH] fugitive: Use FugitiveHead() instead of fugitive#head function if possible and use it instead of the fugitive#head (which will always autload the fugitive plugin). --- autoload/airline/extensions/branch.vim | 3 ++- autoload/airline/util.vim | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/airline/extensions/branch.vim b/autoload/airline/extensions/branch.vim index 1bb0773..b4152b5 100644 --- a/autoload/airline/extensions/branch.vim +++ b/autoload/airline/extensions/branch.vim @@ -86,7 +86,8 @@ function! s:update_git_branch() return endif - let s:vcs_config['git'].branch = fugitive#head(s:sha1size) + let s:vcs_config['git'].branch = exists("*FugitiveHead") ? + \ FugitiveHead(s:sha1size) : fugitive#head(s:sha1size) if s:vcs_config['git'].branch is# 'master' && winwidth(0) < 81 " Shorten default a bit let s:vcs_config['git'].branch='mas' diff --git a/autoload/airline/util.vim b/autoload/airline/util.vim index f2a57ce..2261510 100644 --- a/autoload/airline/util.vim +++ b/autoload/airline/util.vim @@ -105,7 +105,7 @@ function! airline#util#ignore_buf(name) endfunction function! airline#util#has_fugitive() - return exists('*fugitive#head') || exists('*FugitiveStatusline') + return exists('*fugitive#head') || exists('*FugitiveHead') endfunction function! airline#util#has_lawrencium()