comparison src/quickfix.c @ 11195:13c660bd07b2 v8.0.0484

patch 8.0.0484: :lhelpgrep does not fail after a successful one commit https://github.com/vim/vim/commit/ee85df37634dfb0c40ae5de0b4f246aef460b392 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 19 14:19:50 2017 +0100 patch 8.0.0484: :lhelpgrep does not fail after a successful one Problem: Using :lhelpgrep with an argument that should fail does not produce an error if the previous :helpgrep worked. Solution: Use another way to detect that autocommands made the quickfix info invalid. (Yegappan Lakshmanan)
author Christian Brabandt <cb@256bit.org>
date Sun, 19 Mar 2017 14:30:04 +0100
parents 501f46f7644c
children ae5f9f26f81c
comparison
equal deleted inserted replaced
11194:a6434de9107c 11195:13c660bd07b2
5075 long lnum; 5075 long lnum;
5076 #ifdef FEAT_MULTI_LANG 5076 #ifdef FEAT_MULTI_LANG
5077 char_u *lang; 5077 char_u *lang;
5078 #endif 5078 #endif
5079 qf_info_T *qi = &ql_info; 5079 qf_info_T *qi = &ql_info;
5080 qf_info_T *save_qi;
5080 int new_qi = FALSE; 5081 int new_qi = FALSE;
5081 win_T *wp; 5082 win_T *wp;
5082 #ifdef FEAT_AUTOCMD 5083 #ifdef FEAT_AUTOCMD
5083 char_u *au_name = NULL; 5084 char_u *au_name = NULL;
5084 #endif 5085 #endif
5127 if ((qi = ll_new_list()) == NULL) 5128 if ((qi = ll_new_list()) == NULL)
5128 return; 5129 return;
5129 new_qi = TRUE; 5130 new_qi = TRUE;
5130 } 5131 }
5131 } 5132 }
5133
5134 /* Autocommands may change the list. Save it for later comparison */
5135 save_qi = qi;
5132 5136
5133 regmatch.regprog = vim_regcomp(eap->arg, RE_MAGIC + RE_STRING); 5137 regmatch.regprog = vim_regcomp(eap->arg, RE_MAGIC + RE_STRING);
5134 regmatch.rm_ic = FALSE; 5138 regmatch.rm_ic = FALSE;
5135 if (regmatch.regprog != NULL) 5139 if (regmatch.regprog != NULL)
5136 { 5140 {
5260 #ifdef FEAT_AUTOCMD 5264 #ifdef FEAT_AUTOCMD
5261 if (au_name != NULL) 5265 if (au_name != NULL)
5262 { 5266 {
5263 apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, 5267 apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
5264 curbuf->b_fname, TRUE, curbuf); 5268 curbuf->b_fname, TRUE, curbuf);
5265 if (!new_qi && qi != &ql_info && qf_find_buf(qi) == NULL) 5269 if (!new_qi && qi != save_qi && qf_find_buf(qi) == NULL)
5266 /* autocommands made "qi" invalid */ 5270 /* autocommands made "qi" invalid */
5267 return; 5271 return;
5268 } 5272 }
5269 #endif 5273 #endif
5270 5274