mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 11:33:47 -05:00
Avoid invalid glob during tab complete
Resolves: https://github.com/tpope/vim-fugitive/issues/2050
This commit is contained in:
@@ -2397,7 +2397,7 @@ function! s:GlobComplete(lead, pattern, ...) abort
|
|||||||
if a:lead ==# '/'
|
if a:lead ==# '/'
|
||||||
return []
|
return []
|
||||||
else
|
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
|
endif
|
||||||
call map(results, 'v:val !~# "/$" && isdirectory(v:val) ? v:val."/" : v:val')
|
call map(results, 'v:val !~# "/$" && isdirectory(v:val) ? v:val."/" : v:val')
|
||||||
call map(results, 'v:val[ strlen(a:lead) : -1 ]')
|
call map(results, 'v:val[ strlen(a:lead) : -1 ]')
|
||||||
|
|||||||
Reference in New Issue
Block a user