mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 14:53:51 -05:00
Work around 'suffixes' in :Git completion
Closes https://github.com/tpope/vim-fugitive/issues/1682
This commit is contained in:
@@ -1488,11 +1488,11 @@ function! s:FilterEscape(items, ...) abort
|
|||||||
return items
|
return items
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:GlobComplete(lead, pattern) abort
|
function! s:GlobComplete(lead, pattern, ...) abort
|
||||||
if a:lead ==# '/'
|
if a:lead ==# '/'
|
||||||
return []
|
return []
|
||||||
elseif v:version >= 704
|
elseif v:version >= 704
|
||||||
let results = glob(a:lead . a:pattern, 0, 1)
|
let results = glob(a:lead . a:pattern, a:0 ? a:1 : 0, 1)
|
||||||
else
|
else
|
||||||
let results = split(glob(a:lead . a:pattern), "\n")
|
let results = split(glob(a:lead . a:pattern), "\n")
|
||||||
endif
|
endif
|
||||||
@@ -2662,7 +2662,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:Subcommands() abort
|
function! s:Subcommands() abort
|
||||||
let exec_path = s:ExecPath()
|
let exec_path = s:ExecPath()
|
||||||
return map(split(glob(exec_path.'/git-*'),"\n"),'s:sub(v:val[strlen(exec_path)+5 : -1],"\\.exe$","")')
|
return map(s:GlobComplete(exec_path.'/git-', '*', 1),'substitute(v:val,"\\.exe$","","")')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let s:aliases = {}
|
let s:aliases = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user