File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3286,6 +3286,7 @@ ex_vimgrep(exarg_T *eap)
32863286 int fcount ;
32873287 char_u * * fnames ;
32883288 char_u * fname ;
3289+ char_u * title ;
32893290 char_u * s ;
32903291 char_u * p ;
32913292 int fi ;
@@ -3354,6 +3355,7 @@ ex_vimgrep(exarg_T *eap)
33543355
33553356 /* Get the search pattern: either white-separated or enclosed in // */
33563357 regmatch .regprog = NULL ;
3358+ title = vim_strsave (* eap -> cmdlinep );
33573359 p = skip_vimgrep_pat (eap -> arg , & s , & flags );
33583360 if (p == NULL )
33593361 {
@@ -3390,7 +3392,7 @@ ex_vimgrep(exarg_T *eap)
33903392 eap -> cmdidx != CMD_vimgrepadd && eap -> cmdidx != CMD_lvimgrepadd )
33913393 || qi -> qf_curlist == qi -> qf_listcount )
33923394 /* make place for a new list */
3393- qf_new_list (qi , * eap -> cmdlinep );
3395+ qf_new_list (qi , title != NULL ? title : * eap -> cmdlinep );
33943396 else if (qi -> qf_lists [qi -> qf_curlist ].qf_count > 0 )
33953397 /* Adding to existing list, find last entry. */
33963398 for (prevp = qi -> qf_lists [qi -> qf_curlist ].qf_start ;
@@ -3669,6 +3671,7 @@ ex_vimgrep(exarg_T *eap)
36693671 }
36703672
36713673theend :
3674+ vim_free (title );
36723675 vim_free (dirname_now );
36733676 vim_free (dirname_start );
36743677 vim_free (target_dir );
Original file line number Diff line number Diff line change @@ -317,6 +317,23 @@ func Test_errortitle()
317317 augroup ! QfBufWinEnter
318318endfunc
319319
320+ func Test_vimgreptitle ()
321+ augroup QfBufWinEnter
322+ au !
323+ au BufWinEnter * :let g: a= get (w: , ' quickfix_title' , ' NONE' )
324+ augroup END
325+ try
326+ vimgrep /pattern/ j file
327+ catch /E480/
328+ endtry
329+ copen
330+ call assert_equal (' : vimgrep /pattern/j file' , g: a )
331+ augroup QfBufWinEnter
332+ au !
333+ augroup END
334+ augroup ! QfBufWinEnter
335+ endfunc
336+
320337function XqfTitleTests (cchar)
321338 let Xgetexpr = a: cchar . ' getexpr'
322339 if a: cchar == ' c'
Original file line number Diff line number Diff line change @@ -748,6 +748,8 @@ static char *(features[]) =
748748
749749static int included_patches [] =
750750{ /* Add new patch number below this line */
751+ /**/
752+ 1591 ,
751753/**/
752754 1590 ,
753755/**/
You can’t perform that action at this time.
0 commit comments