From 69f5fcbd459c113181d18a0ea2641cd47c9e0318 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 10 Oct 2021 13:23:10 -0400 Subject: [PATCH] Allow escaped characters in tab complete Resolves: https://github.com/tpope/vim-fugitive/issues/1859 --- autoload/fugitive.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index a71a4a1..a7303da 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2288,8 +2288,9 @@ function! s:FilterEscape(items, ...) abort let items = copy(a:items) call map(items, 's:fnameescape(v:val)') if a:0 && type(a:1) == type('') + let match = fnameescape(a:1) let cmp = s:FileIgnoreCase(1) ? '==?' : '==#' - call filter(items, 'strpart(v:val, 0, strlen(a:1)) ' . cmp . ' a:1') + call filter(items, 'strpart(v:val, 0, strlen(match)) ' . cmp . ' match') endif return items endfunction