diff src/message.c @ 23102:3239b0f3c592 v8.2.2097

patch 8.2.2097: Vim9: using :silent! when calling a function prevents abort Commit: https://github.com/vim/vim/commit/56602ba153af7130b76daf83933922aaea3e2646 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 5 21:22:08 2020 +0100 patch 8.2.2097: Vim9: using :silent! when calling a function prevents abort Problem: Vim9: using :silent! when calling a function prevents abortng that function. Solution: Add emsg_silent_def and did_emsg_def.
author Bram Moolenaar <Bram@vim.org>
date Sat, 05 Dec 2020 21:30:03 +0100
parents fb27d3a7a24b
children 0bd44e94dd14
line wrap: on
line diff
--- a/src/message.c
+++ b/src/message.c
@@ -697,6 +697,12 @@ emsg_core(char_u *s)
 		}
 		redir_write(s, -1);
 	    }
+#ifdef FEAT_EVAL
+	    // Only increment did_emsg_def when :silent! wasn't used inside the
+	    // :def function.
+	    if (emsg_silent == emsg_silent_def)
+		++did_emsg_def;
+#endif
 #ifdef FEAT_JOB_CHANNEL
 	    ch_log(NULL, "ERROR silent: %s", (char *)s);
 #endif