diff options
author | Daniel Hahler <github@thequod.de> | 2017-03-11 13:56:23 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-03-11 13:56:23 +0100 |
commit | eb8cbfc8f514c5c84741f782314dc9c256b6d977 (patch) | |
tree | 8fd1253df4cfabc8f9f6513a2d1b9571b106394b /src/nvim/quickfix.c | |
parent | d1afd434f30202410b217e7137c4a2a4fe055dbe (diff) | |
download | rneovim-eb8cbfc8f514c5c84741f782314dc9c256b6d977.tar.gz rneovim-eb8cbfc8f514c5c84741f782314dc9c256b6d977.tar.bz2 rneovim-eb8cbfc8f514c5c84741f782314dc9c256b6d977.zip |
vim-patch:8.0.0068 (#6243)
Problem: Checking did_throw after executing autocommands is wrong. (Daniel
Hahler)
Solution: Call aborting() instead, and only when autocommands were executed.
https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r-- | src/nvim/quickfix.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index c4b8d266cf..40a8066f75 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -3023,11 +3023,11 @@ void ex_make(exarg_T *eap) case CMD_lgrepadd: au_name = (char_u *)"lgrepadd"; break; default: break; } - if (au_name != NULL) { - apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, - curbuf->b_fname, TRUE, curbuf); - if (did_throw || force_abort) + if (au_name != NULL && apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, + curbuf->b_fname, true, curbuf)) { + if (aborting()) { return; + } } if (eap->cmdidx == CMD_lmake || eap->cmdidx == CMD_lgrep @@ -3487,11 +3487,11 @@ void ex_vimgrep(exarg_T *eap) case CMD_lgrepadd: au_name = (char_u *)"lgrepadd"; break; default: break; } - if (au_name != NULL) { - apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, - curbuf->b_fname, TRUE, curbuf); - if (did_throw || force_abort) + if (au_name != NULL && apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, + curbuf->b_fname, true, curbuf)) { + if (aborting()) { return; + } } if (eap->cmdidx == CMD_lgrep @@ -4310,10 +4310,9 @@ void ex_cbuffer(exarg_T *eap) break; } - if (au_name != NULL) { - apply_autocmds(EVENT_QUICKFIXCMDPRE, (char_u *)au_name, - curbuf->b_fname, true, curbuf); - if (did_throw || force_abort) { + if (au_name != NULL && apply_autocmds(EVENT_QUICKFIXCMDPRE, (char_u *)au_name, + curbuf->b_fname, true, curbuf)) { + if (aborting()) { return; } } @@ -4396,10 +4395,9 @@ void ex_cexpr(exarg_T *eap) default: break; } - if (au_name != NULL) { - apply_autocmds(EVENT_QUICKFIXCMDPRE, (char_u *)au_name, - curbuf->b_fname, true, curbuf); - if (did_throw || force_abort) { + if (au_name != NULL && apply_autocmds(EVENT_QUICKFIXCMDPRE, (char_u *)au_name, + curbuf->b_fname, true, curbuf)) { + if (aborting()) { return; } } @@ -4455,11 +4453,11 @@ void ex_helpgrep(exarg_T *eap) case CMD_lhelpgrep: au_name = (char_u *)"lhelpgrep"; break; default: break; } - if (au_name != NULL) { - apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, - curbuf->b_fname, TRUE, curbuf); - if (did_throw || force_abort) + if (au_name != NULL && apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, + curbuf->b_fname, true, curbuf)) { + if (aborting()) { return; + } } /* Make 'cpoptions' empty, the 'l' flag should not be used here. */ |