int fcount;
char_u **fnames;
char_u *fname;
+ char_u *title;
char_u *s;
char_u *p;
int fi;
/* Get the search pattern: either white-separated or enclosed in // */
regmatch.regprog = NULL;
+ title = vim_strsave(*eap->cmdlinep);
p = skip_vimgrep_pat(eap->arg, &s, &flags);
if (p == NULL)
{
eap->cmdidx != CMD_vimgrepadd && eap->cmdidx != CMD_lvimgrepadd)
|| qi->qf_curlist == qi->qf_listcount)
/* make place for a new list */
- qf_new_list(qi, *eap->cmdlinep);
+ qf_new_list(qi, title != NULL ? title : *eap->cmdlinep);
else if (qi->qf_lists[qi->qf_curlist].qf_count > 0)
/* Adding to existing list, find last entry. */
for (prevp = qi->qf_lists[qi->qf_curlist].qf_start;
}
theend:
+ vim_free(title);
vim_free(dirname_now);
vim_free(dirname_start);
vim_free(target_dir);
augroup! QfBufWinEnter
endfunc
+func Test_vimgreptitle()
+ augroup QfBufWinEnter
+ au!
+ au BufWinEnter * :let g:a=get(w:, 'quickfix_title', 'NONE')
+ augroup END
+ try
+ vimgrep /pattern/j file
+ catch /E480/
+ endtry
+ copen
+ call assert_equal(': vimgrep /pattern/j file', g:a)
+ augroup QfBufWinEnter
+ au!
+ augroup END
+ augroup! QfBufWinEnter
+endfunc
+
function XqfTitleTests(cchar)
let Xgetexpr = a:cchar . 'getexpr'
if a:cchar == 'c'