Fix version check for doautocmd <nomodeline>

This commit is contained in:
Tim Pope 2019-08-16 06:11:29 -04:00
parent 22e9b26075
commit 86c276d629

View File

@ -3728,12 +3728,12 @@ function! s:GrepSubcommand(line1, line2, range, bang, mods, args) abort
redraw redraw
call s:QuickfixCreate(listnr, {'title': (listnr < 0 ? ':Ggrep ' : ':Glgrep ') . s:fnameescape(args)}) call s:QuickfixCreate(listnr, {'title': (listnr < 0 ? ':Ggrep ' : ':Glgrep ') . s:fnameescape(args)})
let tempfile = tempname() let tempfile = tempname()
if v:version > 704 | exe 'silent doautocmd <nomodeline> QuickFixCmdPre ' (listnr < 0 ? 'Ggrep' : 'Glgrep') | endif if v:version >= 704 | exe 'silent doautocmd <nomodeline> QuickFixCmdPre ' (listnr < 0 ? 'Ggrep' : 'Glgrep') | endif
exe '!' . escape(s:UserCommand(dir, cmd + args), '%#!') exe '!' . escape(s:UserCommand(dir, cmd + args), '%#!')
\ printf(&shellpipe . (&shellpipe =~# '%s' ? '' : ' %s'), s:shellesc(tempfile)) \ printf(&shellpipe . (&shellpipe =~# '%s' ? '' : ' %s'), s:shellesc(tempfile))
let list = map(readfile(tempfile), 's:GrepParseLine(prefix, name_only, dir, v:val)') let list = map(readfile(tempfile), 's:GrepParseLine(prefix, name_only, dir, v:val)')
call s:QuickfixSet(listnr, list, 'a') call s:QuickfixSet(listnr, list, 'a')
if v:version > 704 | exe 'silent doautocmd <nomodeline> QuickFixCmdPost ' (listnr < 0 ? 'Ggrep' : 'Glgrep') | endif if v:version >= 704 | exe 'silent doautocmd <nomodeline> QuickFixCmdPost ' (listnr < 0 ? 'Ggrep' : 'Glgrep') | endif
if !has('gui_running') if !has('gui_running')
redraw redraw
endif endif