Fix subcommand complete when cursor mid-line
This commit is contained in:
parent
716f3d2d4e
commit
188692556a
@ -655,12 +655,12 @@ function! fugitive#git_commands() abort
|
|||||||
return 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
|
endfunction
|
||||||
|
|
||||||
function! s:GitComplete(A,L,P) abort
|
function! s:GitComplete(A, L, P) abort
|
||||||
let cmds = fugitive#git_commands()
|
if strpart(a:L, 0, a:P) !~# ' [[:alnum:]-]\+ '
|
||||||
if a:L =~ ' [[:alnum:]-]\+ '
|
let cmds = fugitive#git_commands()
|
||||||
return s:repo().superglob(a:A)
|
|
||||||
else
|
|
||||||
return filter(sort(cmds+keys(s:repo().aliases())), 'strpart(v:val, 0, strlen(a:A)) ==# a:A')
|
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
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user