Skip to content

Commit 651ca15

Browse files
committed
updated for version 7.3.197
Problem: When a QuickfixCmdPost event removes all errors, Vim still tries to jump to the first error, resulting in E42. Solution: Get the number of error after the autocmd event. (Mike Lundy)
1 parent ed7e7e9 commit 651ca15

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/quickfix.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2813,17 +2813,21 @@ ex_make(eap)
28132813
(eap->cmdidx != CMD_grepadd
28142814
&& eap->cmdidx != CMD_lgrepadd),
28152815
*eap->cmdlinep);
2816+
if (wp != NULL)
2817+
qi = GET_LOC_LIST(wp);
28162818
#ifdef FEAT_AUTOCMD
28172819
if (au_name != NULL)
2820+
{
28182821
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
28192822
curbuf->b_fname, TRUE, curbuf);
2823+
if (qi->qf_curlist < qi->qf_listcount)
2824+
res = qi->qf_lists[qi->qf_curlist].qf_count;
2825+
else
2826+
res = 0;
2827+
}
28202828
#endif
28212829
if (res > 0 && !eap->forceit)
2822-
{
2823-
if (wp != NULL)
2824-
qi = GET_LOC_LIST(wp);
28252830
qf_jump(qi, 0, 0, FALSE); /* display first error */
2826-
}
28272831

28282832
mch_remove(fname);
28292833
vim_free(fname);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,8 @@ static char *(features[]) =
709709

710710
static int included_patches[] =
711711
{ /* Add new patch number below this line */
712+
/**/
713+
197,
712714
/**/
713715
196,
714716
/**/

0 commit comments

Comments
 (0)