From 9e4a5239ee2a91f71605a288810419ce3a603df2 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Tue, 18 Feb 2020 18:05:51 +0000 Subject: [PATCH] Respect 'wildignorecase' when completing :Gedit --- autoload/fugitive.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index ad43957..cfc5e8c 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -117,12 +117,13 @@ function! s:Resolve(path) abort return path endfunction -function! s:FileIgnoreCase() abort - return exists('+fileignorecase') && &fileignorecase +function! s:FileIgnoreCase(for_completion) abort + return (exists('+fileignorecase') && &fileignorecase) + \ || (a:for_completion && exists('+wildignorecase') && &wildignorecase) endfunction function! s:cpath(path, ...) abort - if s:FileIgnoreCase() + if s:FileIgnoreCase(0) let path = FugitiveVimPath(tolower(a:path)) else let path = FugitiveVimPath(a:path) @@ -1477,7 +1478,8 @@ function! s:FilterEscape(items, ...) abort let items = copy(a:items) call map(items, 's:fnameescape(v:val)') if a:0 && type(a:1) == type('') - call filter(items, 'strpart(v:val, 0, strlen(a:1)) ==# a:1') + let cmp = s:FileIgnoreCase(1) ? '==?' : '==#' + call filter(items, 'strpart(v:val, 0, strlen(a:1)) ' . cmp . ' a:1') endif return items endfunction