Skip to content
Snippets Groups Projects
Commit 44a3d2ee authored by Jerome Reybert's avatar Jerome Reybert
Browse files

Add magit#get_current_mode API function

It returns a string of the current vimagit mode.
It is used for example by vim-airline vimagit extension. It seems a good
idea that vimagit itself returns the string.

See vim-airline/vim-airline#1602
parent bb3c4802
No related branches found
No related tags found
No related merge requests found
......@@ -1249,6 +1249,16 @@ function! magit#show_version()
\ g:vimagit_version[2]
endfunction
function! magit#get_current_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"
endif
endfunction
command! Magit call magit#show_magit('v')
command! MagitOnly call magit#show_magit('c')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment