From 2e8f99d39b27203cff99e1efc84c682ea60fa264 Mon Sep 17 00:00:00 2001 From: David Zderic Date: Fri, 8 Nov 2013 10:36:59 +1100 Subject: [PATCH] Use VCSCommand to display revision if available --- autoload/airline/extensions/branch.vim | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/branch.vim b/autoload/airline/extensions/branch.vim index 254ce7b9..f61a3da6 100644 --- a/autoload/airline/extensions/branch.vim +++ b/autoload/airline/extensions/branch.vim @@ -4,8 +4,9 @@ let s:has_fugitive = exists('*fugitive#head') let s:has_fugitive_detect = exists('*fugitive#detect') let s:has_lawrencium = exists('*lawrencium#statusline') +let s:has_vcscommand = exists('*VCSCommandGetStatusLine') -if !s:has_fugitive && !s:has_lawrencium +if !s:has_fugitive && !s:has_lawrencium && !s:has_vcscommand finish endif @@ -31,6 +32,15 @@ function! airline#extensions#branch#get_head() endif endif + if empty(head) + if s:has_vcscommand + call VCSCommandEnableBufferSetup() + if exists('b:VCSCommandBufferInfo') + let head = get(b:VCSCommandBufferInfo, 0, '') + endif + endif + endif + return empty(head) || !s:check_in_path() \ ? s:empty_message \ : printf('%s%s', empty(s:symbol) ? '' : s:symbol.(g:airline_symbols.space), head)