comparison src/autocmd.c @ 26608:1eb62546e20c v8.2.3833

patch 8.2.3833: error from term_start() not caught by try/catch Commit: https://github.com/vim/vim/commit/c3f91c0648f4b04a6a9ceb4ccec45ea767a63796 Author: ichizok <gclient.gaap@gmail.com> Date: Fri Dec 17 09:44:33 2021 +0000 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 #9361)
author Bram Moolenaar <Bram@vim.org>
date Fri, 17 Dec 2021 10:45:07 +0100
parents a2e6da79274d
children d1a60043826c
comparison
equal deleted inserted replaced
26607:6569c68ede92 26608:1eb62546e20c
1889 proftime_T wait_time; 1889 proftime_T wait_time;
1890 #endif 1890 #endif
1891 int did_save_redobuff = FALSE; 1891 int did_save_redobuff = FALSE;
1892 save_redo_T save_redo; 1892 save_redo_T save_redo;
1893 int save_KeyTyped = KeyTyped; 1893 int save_KeyTyped = KeyTyped;
1894 int save_did_emsg;
1894 ESTACK_CHECK_DECLARATION 1895 ESTACK_CHECK_DECLARATION
1895 1896
1896 /* 1897 /*
1897 * Quickly return if there are no autocommands for this event or 1898 * Quickly return if there are no autocommands for this event or
1898 * autocommands are blocked. 1899 * autocommands are blocked.
2169 2170
2170 if (nesting == 1) 2171 if (nesting == 1)
2171 // make sure cursor and topline are valid 2172 // make sure cursor and topline are valid
2172 check_lnums(TRUE); 2173 check_lnums(TRUE);
2173 2174
2175 save_did_emsg = did_emsg;
2176
2174 do_cmdline(NULL, getnextac, (void *)&patcmd, 2177 do_cmdline(NULL, getnextac, (void *)&patcmd,
2175 DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT); 2178 DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT);
2179
2180 did_emsg += save_did_emsg;
2176 2181
2177 if (nesting == 1) 2182 if (nesting == 1)
2178 // restore cursor and topline, unless they were changed 2183 // restore cursor and topline, unless they were changed
2179 reset_lnums(); 2184 reset_lnums();
2180 2185