comparison src/quickfix.c @ 3269:5850b5827691 v7.3.403

updated for version 7.3.403 Problem: ":helpgrep" does not trigger QuickFixCmd* autocommands. Solution: Trigger the autocommands. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Fri, 20 Jan 2012 13:39:07 +0100
parents 4eda43e1fce0
children 9ccdc4a69d8f
comparison
equal deleted inserted replaced
3268:a8adbe28d150 3269:5850b5827691
3876 char_u *lang; 3876 char_u *lang;
3877 #endif 3877 #endif
3878 qf_info_T *qi = &ql_info; 3878 qf_info_T *qi = &ql_info;
3879 int new_qi = FALSE; 3879 int new_qi = FALSE;
3880 win_T *wp; 3880 win_T *wp;
3881 #ifdef FEAT_AUTOCMD
3882 char_u *au_name = NULL;
3883 #endif
3884
3885 #ifdef FEAT_MULTI_LANG
3886 /* Check for a specified language */
3887 lang = check_help_lang(eap->arg);
3888 #endif
3889
3890 #ifdef FEAT_AUTOCMD
3891 switch (eap->cmdidx)
3892 {
3893 case CMD_helpgrep: au_name = (char_u *)"helpgrep"; break;
3894 case CMD_lhelpgrep: au_name = (char_u *)"lhelpgrep"; break;
3895 default: break;
3896 }
3897 if (au_name != NULL)
3898 {
3899 apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name,
3900 curbuf->b_fname, TRUE, curbuf);
3901 if (did_throw || force_abort)
3902 return;
3903 }
3904 #endif
3881 3905
3882 /* Make 'cpoptions' empty, the 'l' flag should not be used here. */ 3906 /* Make 'cpoptions' empty, the 'l' flag should not be used here. */
3883 save_cpo = p_cpo; 3907 save_cpo = p_cpo;
3884 p_cpo = empty_option; 3908 p_cpo = empty_option;
3885
3886 #ifdef FEAT_MULTI_LANG
3887 /* Check for a specified language */
3888 lang = check_help_lang(eap->arg);
3889 #endif
3890 3909
3891 if (eap->cmdidx == CMD_lhelpgrep) 3910 if (eap->cmdidx == CMD_lhelpgrep)
3892 { 3911 {
3893 /* Find an existing help window */ 3912 /* Find an existing help window */
3894 FOR_ALL_WINDOWS(wp) 3913 FOR_ALL_WINDOWS(wp)
4034 4053
4035 #ifdef FEAT_WINDOWS 4054 #ifdef FEAT_WINDOWS
4036 qf_update_buffer(qi); 4055 qf_update_buffer(qi);
4037 #endif 4056 #endif
4038 4057
4058 #ifdef FEAT_AUTOCMD
4059 if (au_name != NULL)
4060 {
4061 apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
4062 curbuf->b_fname, TRUE, curbuf);
4063 if (!new_qi && qi != &ql_info && qf_find_buf(qi) == NULL)
4064 /* autocommands made "qi" invalid */
4065 return;
4066 }
4067 #endif
4068
4039 /* Jump to first match. */ 4069 /* Jump to first match. */
4040 if (qi->qf_lists[qi->qf_curlist].qf_count > 0) 4070 if (qi->qf_lists[qi->qf_curlist].qf_count > 0)
4041 qf_jump(qi, 0, 0, FALSE); 4071 qf_jump(qi, 0, 0, FALSE);
4042 else 4072 else
4043 EMSG2(_(e_nomatch2), eap->arg); 4073 EMSG2(_(e_nomatch2), eap->arg);