mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-23 08:28:50 +08:00
Use VCSCommand to display revision if available
This commit is contained in:
parent
3c9f8bb979
commit
2e8f99d39b
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user