Fix subcommand complete when cursor mid-line

This commit is contained in:
Tim Pope 2014-06-29 10:58:41 -04:00
parent 716f3d2d4e
commit 188692556a

View File

@ -656,11 +656,11 @@ function! fugitive#git_commands() abort
endfunction
function! s:GitComplete(A, L, P) abort
if strpart(a:L, 0, a:P) !~# ' [[:alnum:]-]\+ '
let cmds = fugitive#git_commands()
if a:L =~ ' [[:alnum:]-]\+ '
return s:repo().superglob(a:A)
else
return filter(sort(cmds+keys(s:repo().aliases())), 'strpart(v:val, 0, strlen(a:A)) ==# a:A')
else
return s:repo().superglob(a:A)
endif
endfunction