Merge pull request #1602 from jreybert/dev/vimagit

vimagit: let vimagit itself returns the current mode
This commit is contained in:
Christian Brabandt 2017-11-20 13:57:42 +01:00 committed by GitHub
commit d719d0664a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,14 +13,18 @@ function! airline#extensions#vimagit#init(ext)
endfunction endfunction
function! airline#extensions#vimagit#get_mode() function! airline#extensions#vimagit#get_mode()
if ( b:magit_current_commit_mode == '' ) if ( exists("*magit#get_current_mode") )
return "STAGING" return magit#get_current_mode()
elseif ( b:magit_current_commit_mode == 'CC' ) else
return "COMMIT" if ( b:magit_current_commit_mode == '' )
elseif ( b:magit_current_commit_mode == 'CA' ) return "STAGING"
return "AMEND" elseif ( b:magit_current_commit_mode == 'CC' )
else return "COMMIT"
return "???" elseif ( b:magit_current_commit_mode == 'CA' )
return "AMEND"
else
return "???"
endif
endfunction endfunction
function! airline#extensions#vimagit#apply(...) function! airline#extensions#vimagit#apply(...)