From 201bdd0eff4cd79847cf006f143deb62f8f97342 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 12 Sep 2011 17:02:07 -0400 Subject: [PATCH] Fix completion of :Gedit! --- plugin/fugitive.vim | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index b5329eb..17d52fc 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1019,6 +1019,10 @@ function! s:Edit(cmd,bang,...) abort endfunction function! s:EditComplete(A,L,P) abort + return s:repo().superglob(a:A) +endfunction + +function! s:EditRunComplete(A,L,P) abort if a:L =~# '^\w\+!' return s:GitComplete(a:A,a:L,a:P) else @@ -1028,11 +1032,11 @@ endfunction call s:command("-bar -bang -nargs=? -complete=customlist,s:EditComplete Ge :execute s:Edit('edit',0,)") call s:command("-bar -bang -nargs=? -complete=customlist,s:EditComplete Gedit :execute s:Edit('edit',0,)") -call s:command("-bar -bang -nargs=? -complete=customlist,s:EditComplete Gpedit :execute s:Edit('pedit',0,)") -call s:command("-bar -bang -nargs=? -complete=customlist,s:EditComplete Gsplit :execute s:Edit('split',0,)") -call s:command("-bar -bang -nargs=? -complete=customlist,s:EditComplete Gvsplit :execute s:Edit('vsplit',0,)") -call s:command("-bar -bang -nargs=? -complete=customlist,s:EditComplete Gtabedit :execute s:Edit('tabedit',0,)") -call s:command("-bar -bang -nargs=? -count -complete=customlist,s:EditComplete Gread :execute s:Edit((! && ? '' : ).'read',0,)") +call s:command("-bar -bang -nargs=? -complete=customlist,s:EditRunComplete Gpedit :execute s:Edit('pedit',0,)") +call s:command("-bar -bang -nargs=? -complete=customlist,s:EditRunComplete Gsplit :execute s:Edit('split',0,)") +call s:command("-bar -bang -nargs=? -complete=customlist,s:EditRunComplete Gvsplit :execute s:Edit('vsplit',0,)") +call s:command("-bar -bang -nargs=? -complete=customlist,s:EditRunComplete Gtabedit :execute s:Edit('tabedit',0,)") +call s:command("-bar -bang -nargs=? -count -complete=customlist,s:EditRunComplete Gread :execute s:Edit((! && ? '' : ).'read',0,)") " }}}1 " Gwrite, Gwq {{{1