commit 716f3d2d4e82087131c35b2f92fff8619f8a8d9e (tree)
parent 8576741d61126354e4f739e4112985cec651e2e3
Author: Tim Pope <code@tpope.net>
Date: Sun, 29 Jun 2014 10:53:52 -0400
Expose list of global git subcommands
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim
@@ -648,11 +648,15 @@ function! s:Git(bang, args) abort
return matchstr(a:args, '\v\C\\@<!%(\\\\)*\|\zs.*')
endfunction
-function! s:GitComplete(A,L,P) abort
+function! fugitive#git_commands() abort
if !exists('s:exec_path')
let s:exec_path = s:sub(system(g:fugitive_git_executable.' --exec-path'),'\n$','')
endif
- let cmds = map(split(glob(s:exec_path.'/git-*'),"\n"),'s:sub(v:val[strlen(s:exec_path)+5 : -1],"\\.exe$","")')
+ return map(split(glob(s:exec_path.'/git-*'),"\n"),'s:sub(v:val[strlen(s:exec_path)+5 : -1],"\\.exe$","")')
+endfunction
+
+function! s:GitComplete(A,L,P) abort
+ let cmds = fugitive#git_commands()
if a:L =~ ' [[:alnum:]-]\+ '
return s:repo().superglob(a:A)
else