vim-patch:8.1.2220: :cfile does not abort like other quickfix commands

Problem:    :cfile does not abort like other quickfix commands.
Solution:   Abort when desired. Add tests for aborting. (Yegappan Lakshmanan,
            closes vim/vim#5121)
6a0cc916bd
This commit is contained in:
Jan Edmund Lazo
2019-10-26 20:06:29 -04:00
parent 6d8fe9b3f4
commit c3d81a4902
2 changed files with 99 additions and 4 deletions

View File

@@ -4152,10 +4152,15 @@ void ex_cfile(exarg_T *eap)
case CMD_laddfile: au_name = (char_u *)"laddfile"; break;
default: break;
}
if (au_name != NULL)
apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, NULL, FALSE, curbuf);
if (*eap->arg != NUL)
if (au_name != NULL
&& apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, NULL, false, curbuf)) {
if (aborting()) {
return;
}
}
if (*eap->arg != NUL) {
set_string_option_direct((char_u *)"ef", -1, eap->arg, OPT_FREE, 0);
}
char_u *enc = (*curbuf->b_p_menc != NUL) ? curbuf->b_p_menc : p_menc;