Skip to content

Commit 71b0488

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 755e60a + 5584df6 commit 71b0488

4 files changed

Lines changed: 27 additions & 2 deletions

File tree

src/eval.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21687,7 +21687,6 @@ handle_subscript(
2168721687
char_u *s;
2168821688
int len;
2168921689
typval_T functv;
21690-
partial_T *pt = NULL;
2169121690

2169221691
while (ret == OK
2169321692
&& (**arg == '['
@@ -21698,6 +21697,8 @@ handle_subscript(
2169821697
{
2169921698
if (**arg == '(')
2170021699
{
21700+
partial_T *pt = NULL;
21701+
2170121702
/* need to copy the funcref so that we can clear rettv */
2170221703
if (evaluate)
2170321704
{

src/quickfix.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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

36713673
theend:
3674+
vim_free(title);
36723675
vim_free(dirname_now);
36733676
vim_free(dirname_start);
36743677
vim_free(target_dir);

src/testdir/test_quickfix.vim

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,23 @@ func Test_errortitle()
317317
augroup! QfBufWinEnter
318318
endfunc
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+
320337
function XqfTitleTests(cchar)
321338
let Xgetexpr = a:cchar . 'getexpr'
322339
if a:cchar == 'c'

src/version.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,10 @@ static char *(features[]) =
763763

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
1591,
768+
/**/
769+
1590,
766770
/**/
767771
1589,
768772
/**/

0 commit comments

Comments
 (0)