Merge pull request #335 from dzderic/master

Use VCSCommand to display revision if available
This commit is contained in:
Bailey Ling 2013-11-08 05:29:40 -08:00
commit 02441be0e1

View File

@ -4,8 +4,9 @@
let s:has_fugitive = exists('*fugitive#head') let s:has_fugitive = exists('*fugitive#head')
let s:has_fugitive_detect = exists('*fugitive#detect') let s:has_fugitive_detect = exists('*fugitive#detect')
let s:has_lawrencium = exists('*lawrencium#statusline') 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 finish
endif endif
@ -31,6 +32,15 @@ function! airline#extensions#branch#get_head()
endif endif
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() return empty(head) || !s:check_in_path()
\ ? s:empty_message \ ? s:empty_message
\ : printf('%s%s', empty(s:symbol) ? '' : s:symbol.(g:airline_symbols.space), head) \ : printf('%s%s', empty(s:symbol) ? '' : s:symbol.(g:airline_symbols.space), head)