forked from aniani/vim
updated for version 7.3.756
Problem: A location list can get a wrong count in :lvimgrep. Solution: Check if the list was changed by autocommands. (mostly by Christian Brabandt)
This commit is contained in:
@@ -3109,6 +3109,9 @@ ex_vimgrep(eap)
|
|||||||
char_u *p;
|
char_u *p;
|
||||||
int fi;
|
int fi;
|
||||||
qf_info_T *qi = &ql_info;
|
qf_info_T *qi = &ql_info;
|
||||||
|
#ifdef FEAT_AUTOCMD
|
||||||
|
qfline_T *cur_qf_start;
|
||||||
|
#endif
|
||||||
qfline_T *prevp = NULL;
|
qfline_T *prevp = NULL;
|
||||||
long lnum;
|
long lnum;
|
||||||
buf_T *buf;
|
buf_T *buf;
|
||||||
@@ -3218,6 +3221,12 @@ ex_vimgrep(eap)
|
|||||||
* ":lcd %:p:h" changes the meaning of short path names. */
|
* ":lcd %:p:h" changes the meaning of short path names. */
|
||||||
mch_dirname(dirname_start, MAXPATHL);
|
mch_dirname(dirname_start, MAXPATHL);
|
||||||
|
|
||||||
|
#ifdef FEAT_AUTOCMD
|
||||||
|
/* Remeber the value of qf_start, so that we can check for autocommands
|
||||||
|
* changing the current quickfix list. */
|
||||||
|
cur_qf_start = qi->qf_lists[qi->qf_curlist].qf_start;
|
||||||
|
#endif
|
||||||
|
|
||||||
seconds = (time_t)0;
|
seconds = (time_t)0;
|
||||||
for (fi = 0; fi < fcount && !got_int && tomatch > 0; ++fi)
|
for (fi = 0; fi < fcount && !got_int && tomatch > 0; ++fi)
|
||||||
{
|
{
|
||||||
@@ -3273,6 +3282,28 @@ ex_vimgrep(eap)
|
|||||||
/* Use existing, loaded buffer. */
|
/* Use existing, loaded buffer. */
|
||||||
using_dummy = FALSE;
|
using_dummy = FALSE;
|
||||||
|
|
||||||
|
#ifdef FEAT_AUTOCMD
|
||||||
|
if (cur_qf_start != qi->qf_lists[qi->qf_curlist].qf_start)
|
||||||
|
{
|
||||||
|
int idx;
|
||||||
|
|
||||||
|
/* Autocommands changed the quickfix list. Find the one we were
|
||||||
|
* using and restore it. */
|
||||||
|
for (idx = 0; idx < LISTCOUNT; ++idx)
|
||||||
|
if (cur_qf_start == qi->qf_lists[idx].qf_start)
|
||||||
|
{
|
||||||
|
qi->qf_curlist = idx;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (idx == LISTCOUNT)
|
||||||
|
{
|
||||||
|
/* List cannot be found, create a new one. */
|
||||||
|
qf_new_list(qi, *eap->cmdlinep);
|
||||||
|
cur_qf_start = qi->qf_lists[qi->qf_curlist].qf_start;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (buf == NULL)
|
if (buf == NULL)
|
||||||
{
|
{
|
||||||
if (!got_int)
|
if (!got_int)
|
||||||
@@ -3324,6 +3355,9 @@ ex_vimgrep(eap)
|
|||||||
if (got_int)
|
if (got_int)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifdef FEAT_AUTOCMD
|
||||||
|
cur_qf_start = qi->qf_lists[qi->qf_curlist].qf_start;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (using_dummy)
|
if (using_dummy)
|
||||||
{
|
{
|
||||||
|
@@ -725,6 +725,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
756,
|
||||||
/**/
|
/**/
|
||||||
755,
|
755,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user