mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 23:03:51 -05:00
Adjust encapsulation of escaped completion handling
Most calls to s:FilterEscape() pass the original escaped argument, so we should fix the callers that don't.
This commit is contained in:
@@ -2288,9 +2288,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('')
|
||||||
let match = fnameescape(a:1)
|
|
||||||
let cmp = s:FileIgnoreCase(1) ? '==?' : '==#'
|
let cmp = s:FileIgnoreCase(1) ? '==?' : '==#'
|
||||||
call filter(items, 'strpart(v:val, 0, strlen(match)) ' . cmp . ' match')
|
call filter(items, 'strpart(v:val, 0, strlen(a:1)) ' . cmp . ' a:1')
|
||||||
endif
|
endif
|
||||||
return items
|
return items
|
||||||
endfunction
|
endfunction
|
||||||
@@ -2384,7 +2383,7 @@ function! fugitive#CompleteObject(base, ...) abort
|
|||||||
let heads += ["stash"]
|
let heads += ["stash"]
|
||||||
let heads += sort(s:LinesError(["stash","list","--pretty=format:%gd"], dir)[0])
|
let heads += sort(s:LinesError(["stash","list","--pretty=format:%gd"], dir)[0])
|
||||||
endif
|
endif
|
||||||
let results += s:FilterEscape(heads, base)
|
let results += s:FilterEscape(heads, fnameescape(base))
|
||||||
endif
|
endif
|
||||||
let results += a:0 == 1 || a:0 >= 3 ? fugitive#CompletePath(base, 0, '', dir, a:0 >= 4 ? a:4 : tree) : fugitive#CompletePath(base)
|
let results += a:0 == 1 || a:0 >= 3 ? fugitive#CompletePath(base, 0, '', dir, a:0 >= 4 ? a:4 : tree) : fugitive#CompletePath(base)
|
||||||
return results
|
return results
|
||||||
@@ -2406,7 +2405,7 @@ function! fugitive#CompleteObject(base, ...) abort
|
|||||||
call map(entries,'s:sub(v:val,"^04.*\\zs$","/")')
|
call map(entries,'s:sub(v:val,"^04.*\\zs$","/")')
|
||||||
call map(entries,'parent.s:sub(v:val,".*\t","")')
|
call map(entries,'parent.s:sub(v:val,".*\t","")')
|
||||||
endif
|
endif
|
||||||
return s:FilterEscape(entries, base)
|
return s:FilterEscape(entries, fnameescape(base))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:CompleteSub(subcommand, A, L, P, ...) abort
|
function! s:CompleteSub(subcommand, A, L, P, ...) abort
|
||||||
|
|||||||
Reference in New Issue
Block a user