Fix escaping for :Ggrep '#'

This commit is contained in:
Tim Pope 2019-07-19 11:57:16 -04:00
parent adba9c6345
commit 8d584c199a

View File

@ -3470,7 +3470,7 @@ function! s:Grep(type, bang, arg) abort
let title = [listnr < 0 ? ':Ggrep' : ':Glgrep'] + args
call s:QuickfixCreate(listnr, {'title': (listnr < 0 ? ':Ggrep ' : ':Glgrep ') . s:fnameescape(args)})
let tempfile = tempname()
exe '!' . s:shellesc(cmd + args)
exe '!' . escape(s:shellesc(cmd + args), '%#!')
\ printf(&shellpipe . (&shellpipe =~# '%s' ? '' : ' %s'), s:shellesc(tempfile))
let list = map(readfile(tempfile), 's:GrepParseLine(prefix, name_only, dir, v:val)')
call s:QuickfixSet(listnr, list, 'a')