mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 10:26:31 +00:00
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)
c3f91c0648
Co-authored-by: ichizok <gclient.gaap@gmail.com>
This commit is contained in:
@@ -1783,8 +1783,12 @@ bool apply_autocmds_group(event_T event, char *fname, char *fname_io, bool force
|
|||||||
check_lnums_nested(true);
|
check_lnums_nested(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const int save_did_emsg = did_emsg;
|
||||||
|
|
||||||
// Execute the autocmd. The `getnextac` callback handles iteration.
|
// 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) {
|
if (nesting == 1) {
|
||||||
// restore cursor and topline, unless they were changed
|
// restore cursor and topline, unless they were changed
|
||||||
|
Reference in New Issue
Block a user