Don't complete directories as subcommands

This commit is contained in:
Tim Pope
2021-03-23 16:28:47 -04:00
parent 0205ae8d45
commit 53df837ac6

View File

@@ -2780,7 +2780,7 @@ function! s:CompletableSubcommands(dir) abort
endif endif
let cpath = s:cpath(path) let cpath = s:cpath(path)
if !has_key(s:path_subcommands, cpath) if !has_key(s:path_subcommands, cpath)
let s:path_subcommands[cpath] = filter(map(s:GlobComplete(path.'/git-', '*', 1),'substitute(v:val,"\\.exe$","","")'), 'v:val !~# "--"') let s:path_subcommands[cpath] = filter(map(s:GlobComplete(path.'/git-', '*', 1),'substitute(v:val,"\\.exe$","","")'), 'v:val !~# "--\\|/"')
endif endif
call extend(commands, s:path_subcommands[cpath]) call extend(commands, s:path_subcommands[cpath])
endfor endfor