diff src/channel.c @ 25090:73503bafb3bf v8.2.3082

patch 8.2.3082: a channel command "echoerr" does not show anything Commit: https://github.com/vim/vim/commit/b836f631dba2534efd314a8f77439cebc75acd4e Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jul 1 22:11:28 2021 +0200 patch 8.2.3082: a channel command "echoerr" does not show anything Problem: A channel command "echoerr" does not show anything. Solution: Do not use silent errors when using an "echoerr" command. (closes #8494)
author Bram Moolenaar <Bram@vim.org>
date Thu, 01 Jul 2021 22:15:04 +0200
parents 5f6a70167daa
children eafc0e07b188
line wrap: on
line diff
--- a/src/channel.c
+++ b/src/channel.c
@@ -2486,12 +2486,17 @@ channel_exe_cmd(channel_T *channel, ch_p
 
     if (STRCMP(cmd, "ex") == 0)
     {
-	int called_emsg_before = called_emsg;
+	int	called_emsg_before = called_emsg;
+	char_u	*p = arg;
+	int	do_emsg_silent;
 
 	ch_log(channel, "Executing ex command '%s'", (char *)arg);
-	++emsg_silent;
+	do_emsg_silent = !checkforcmd(&p, "echoerr", 5);
+	if (do_emsg_silent)
+	    ++emsg_silent;
 	do_cmdline_cmd(arg);
-	--emsg_silent;
+	if (do_emsg_silent)
+	    --emsg_silent;
 	if (called_emsg > called_emsg_before)
 	    ch_log(channel, "Ex command error: '%s'",
 					  (char *)get_vim_var_str(VV_ERRMSG));