Respect 'wildignorecase' when completing :Gedit

This commit is contained in:
Rob Pilling
2020-02-18 18:05:51 +00:00
committed by Tim Pope
parent 349b18d373
commit 9e4a5239ee

View File

@@ -117,12 +117,13 @@ function! s:Resolve(path) abort
return path return path
endfunction endfunction
function! s:FileIgnoreCase() abort function! s:FileIgnoreCase(for_completion) abort
return exists('+fileignorecase') && &fileignorecase return (exists('+fileignorecase') && &fileignorecase)
\ || (a:for_completion && exists('+wildignorecase') && &wildignorecase)
endfunction endfunction
function! s:cpath(path, ...) abort function! s:cpath(path, ...) abort
if s:FileIgnoreCase() if s:FileIgnoreCase(0)
let path = FugitiveVimPath(tolower(a:path)) let path = FugitiveVimPath(tolower(a:path))
else else
let path = FugitiveVimPath(a:path) let path = FugitiveVimPath(a:path)
@@ -1477,7 +1478,8 @@ function! s:FilterEscape(items, ...) abort
let items = copy(a:items) let items = copy(a:items)
call map(items, 's:fnameescape(v:val)') call map(items, 's:fnameescape(v:val)')
if a:0 && type(a:1) == type('') 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 endif
return items return items
endfunction endfunction