mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-01-19 10:42:46 +08:00
vimagit: let vimagit itself returns the current mode
If current vimagit version does not provide vimagit#get_current_mode(), internal string version is kept.
This commit is contained in:
parent
4a1f65841c
commit
640d6762f7
|
@ -13,14 +13,18 @@ function! airline#extensions#vimagit#init(ext)
|
|||
endfunction
|
||||
|
||||
function! airline#extensions#vimagit#get_mode()
|
||||
if ( b:magit_current_commit_mode == '' )
|
||||
return "STAGING"
|
||||
elseif ( b:magit_current_commit_mode == 'CC' )
|
||||
return "COMMIT"
|
||||
elseif ( b:magit_current_commit_mode == 'CA' )
|
||||
return "AMEND"
|
||||
else
|
||||
return "???"
|
||||
if ( exists("*magit#get_current_mode") )
|
||||
return magit#get_current_mode()
|
||||
else
|
||||
if ( b:magit_current_commit_mode == '' )
|
||||
return "STAGING"
|
||||
elseif ( b:magit_current_commit_mode == 'CC' )
|
||||
return "COMMIT"
|
||||
elseif ( b:magit_current_commit_mode == 'CA' )
|
||||
return "AMEND"
|
||||
else
|
||||
return "???"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#vimagit#apply(...)
|
||||
|
|
Loading…
Reference in New Issue
Block a user