motiejus/dotfiles

Unnamed repository; edit this file 'description' to name the repository.
git clone https://git.jakstys.lt/motiejus/dotfiles.git
Log | Tree | Refs | README | LICENSE

commit 783ec701fecb88ec322c8685c6dae1f27a39853b (tree)
parent d1e74ac267d25be5fb27a3bdeafe1bb08493a420
Author: Tim Pope <code@tpope.net>
Date:   Sun, 21 Feb 2021 14:51:13 -0500

Work around 'suffixes' in :Git completion

Closes https://github.com/tpope/vim-fugitive/issues/1682

Diffstat:
Mautoload/fugitive.vim | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim @@ -1488,11 +1488,11 @@ function! s:FilterEscape(items, ...) abort return items endfunction -function! s:GlobComplete(lead, pattern) abort +function! s:GlobComplete(lead, pattern, ...) abort if a:lead ==# '/' return [] 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 let results = split(glob(a:lead . a:pattern), "\n") endif @@ -2662,7 +2662,7 @@ endfunction function! s:Subcommands() abort 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 let s:aliases = {}