aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-06-26 07:17:45 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-06-26 07:18:54 +0800
commit7966020f70255e04bc7a8015a170307c4d5341a8 (patch)
tree9c273ba445dc810ff6a01e2ea82b626a33662061
parent957d05d16bc80cef14c2e9fe31b6b847e698f9d1 (diff)
downloadrneovim-7966020f70255e04bc7a8015a170307c4d5341a8.tar.gz
rneovim-7966020f70255e04bc7a8015a170307c4d5341a8.tar.bz2
rneovim-7966020f70255e04bc7a8015a170307c4d5341a8.zip
vim-patch:8.2.3833: error from term_start() not caught by try/catch
Problem: Error from term_start() not caught by try/catch. Solution: save and restore did_emsg when applying autocommands. (Ozaki Kiichi, closes vim/vim#9361) https://github.com/vim/vim/commit/c3f91c0648f4b04a6a9ceb4ccec45ea767a63796 Co-authored-by: ichizok <gclient.gaap@gmail.com>
-rw-r--r--src/nvim/autocmd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c
index 427bce0e80..f3eb5d410d 100644
--- a/src/nvim/autocmd.c
+++ b/src/nvim/autocmd.c
@@ -1783,8 +1783,12 @@ bool apply_autocmds_group(event_T event, char *fname, char *fname_io, bool force
check_lnums_nested(true);
}
+ const int save_did_emsg = did_emsg;
+
// Execute the autocmd. The `getnextac` callback handles iteration.
- do_cmdline(NULL, getnextac, (void *)&patcmd, DOCMD_NOWAIT | DOCMD_VERBOSE | DOCMD_REPEAT);
+ do_cmdline(NULL, getnextac, &patcmd, DOCMD_NOWAIT | DOCMD_VERBOSE | DOCMD_REPEAT);
+
+ did_emsg += save_did_emsg;
if (nesting == 1) {
// restore cursor and topline, unless they were changed