From dd8107cabf5fe85df94d5eedcae52415e543f208 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 4 Sep 2022 05:37:27 -0400 Subject: [PATCH] Avoid invalid glob during tab complete Resolves: https://github.com/tpope/vim-fugitive/issues/2050 --- autoload/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 827c265..f3746f6 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2397,7 +2397,7 @@ function! s:GlobComplete(lead, pattern, ...) abort if a:lead ==# '/' return [] else - let results = glob(a:lead . a:pattern, a:0 ? a:1 : 0, 1) + let results = glob(substitute(a:lead . a:pattern, '[\{}]', '\\&', 'g'), a:0 ? a:1 : 0, 1) endif call map(results, 'v:val !~# "/$" && isdirectory(v:val) ? v:val."/" : v:val') call map(results, 'v:val[ strlen(a:lead) : -1 ]')