From 3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 7 Mar 2026 14:15:53 -0500 Subject: [PATCH] Use --list-cmds=others instead of hunting through PATH Resolves: https://github.com/tpope/vim-fugitive/issues/2458 --- autoload/fugitive.vim | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 95d1be5..d0748c1 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -4106,7 +4106,7 @@ function! s:CompletableSubcommands(dir) abort let c_exec_path = s:cpath(s:VimExecPath()) if !has_key(s:path_subcommands, c_exec_path) if fugitive#GitVersion(2, 18) - let [lines, exec_error] = s:LinesError([a:dir, '--list-cmds=list-mainporcelain,nohelpers,list-complete']) + let [lines, exec_error] = s:LinesError([a:dir, '--list-cmds=list-mainporcelain,nohelpers,list-complete,others']) call filter(lines, 'v:val =~# "^\\S\\+$"') if !exec_error && len(lines) let s:path_subcommands[c_exec_path] = lines @@ -4120,16 +4120,6 @@ function! s:CompletableSubcommands(dir) abort endif endif let commands = copy(s:path_subcommands[c_exec_path]) - for path in split($PATH, has('win32') ? ';' : ':') - if path !~# '^/\|^\a:[\\/]' - continue - endif - let cpath = s:cpath(path) - 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 !~# "--\\|/"') - endif - call extend(commands, s:path_subcommands[cpath]) - endfor call extend(commands, keys(fugitive#ConfigGetRegexp('^alias\.\zs[^.]\+$', a:dir))) let configured = split(FugitiveConfigGet('completion.commands', a:dir), '\s\+') let rejected = {}