aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-12-18 07:05:51 -0500
committerGitHub <noreply@github.com>2017-12-18 07:05:51 -0500
commit6b5d92f9e0e9754933abec06e9265027f388357f (patch)
tree000d873abe873ca73656b9ff80963274d634c6eb /src/nvim/quickfix.c
parente6f8b105b00f706ddb8b790a24e37d50711d8dcb (diff)
parent853634881335eb9fe4c593710fbb8c71324e1690 (diff)
downloadrneovim-6b5d92f9e0e9754933abec06e9265027f388357f.tar.gz
rneovim-6b5d92f9e0e9754933abec06e9265027f388357f.tar.bz2
rneovim-6b5d92f9e0e9754933abec06e9265027f388357f.zip
Merge pull request #7740 from jamessan/vim-8.0.0404
[RFC] vim-patch:8.0.0404,8.0.0484
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r--src/nvim/quickfix.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 696f123871..6d59d15515 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -4502,6 +4502,9 @@ void ex_helpgrep(exarg_T *eap)
}
}
+ // Autocommands may change the list. Save it for later comparison
+ qf_info_T *save_qi = qi;
+
regmatch.regprog = vim_regcomp(eap->arg, RE_MAGIC + RE_STRING);
regmatch.rm_ic = FALSE;
if (regmatch.regprog != NULL) {
@@ -4614,10 +4617,11 @@ void ex_helpgrep(exarg_T *eap)
if (au_name != NULL) {
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
- curbuf->b_fname, TRUE, curbuf);
- if (!new_qi && qi != &ql_info && qf_find_buf(qi) == NULL)
- /* autocommands made "qi" invalid */
+ curbuf->b_fname, true, curbuf);
+ if (!new_qi && qi != save_qi && qf_find_buf(qi) == NULL) {
+ // autocommands made "qi" invalid
return;
+ }
}
/* Jump to first match. */