From 8082606fd0809ad9eed2a59ebb6d7e1352d85b74 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 7 Aug 2021 15:49:43 -0400 Subject: [PATCH] Fix direct usage of fnameescape() I plan to lower the minimum Vim version back to 7.0 before shipping 3.4, which means we can't assume the presence of fnameescape(). --- autoload/fugitive.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 1e4f6ee..3ec1f8f 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2296,7 +2296,7 @@ function! fugitive#BufReadStatus() abort if &bufhidden ==# '' setlocal bufhidden=delete endif - let b:dispatch = '-dir=' . fnameescape(len(s:Tree()) ? s:Tree() : s:Dir()) . ' ' . s:GitShellCmd() . ' fetch --all' + let b:dispatch = '-dir=' . s:fnameescape(len(s:Tree()) ? s:Tree() : s:Dir()) . ' ' . s:GitShellCmd() . ' fetch --all' call fugitive#MapJumps() call s:Map('n', '-', ":execute Do('Toggle',0)", '') call s:Map('x', '-', ":execute Do('Toggle',1)", '') @@ -2863,7 +2863,7 @@ function! s:RunWait(state, tmp, job, ...) abort call remove(a:tmp, 'echo') endif call writefile(['fugitive: aborting edit due to background operation.'], a:state.file . '.exit') - exe (&splitbelow ? 'botright' : 'topleft') 'silent pedit ++ff=unix' fnameescape(a:state.file) + exe (&splitbelow ? 'botright' : 'topleft') 'silent pedit ++ff=unix' s:fnameescape(a:state.file) let a:state.capture_bufnr = bufnr(a:state.file) call setbufvar(a:state.capture_bufnr, '&modified', 1) let finished = 0 @@ -6673,7 +6673,7 @@ function! fugitive#MapJumps(...) abort if !exists('g:fugitive_no_maps') if exists(':CtrlP') && get(g:, 'ctrl_p_map') =~? '^$' - nnoremap :execute line('.') == 1 ? 'CtrlP ' . fnameescape(Tree()) : PreviousItem(v:count1) + nnoremap :execute line('.') == 1 ? 'CtrlP ' . s:fnameescape(Tree()) : PreviousItem(v:count1) else nnoremap :execute PreviousItem(v:count1) endif