diff src/message.c @ 9454:9da0cb39cbee v7.4.2008

commit https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 9 17:07:29 2016 +0200 patch 7.4.2008 Problem: evalcmd() has a confusing name. Solution: Rename to execute(). Make silent optional. Support a list of commands.
author Christian Brabandt <cb@256bit.org>
date Sat, 09 Jul 2016 17:15:06 +0200
parents f048e5a27253
children d18d71ae21e5
line wrap: on
line diff
--- a/src/message.c
+++ b/src/message.c
@@ -566,22 +566,25 @@ emsg(char_u *s)
 	 */
 	if (emsg_silent != 0)
 	{
-	    msg_start();
-	    p = get_emsg_source();
-	    if (p != NULL)
+	    if (emsg_noredir == 0)
 	    {
-		STRCAT(p, "\n");
-		redir_write(p, -1);
-		vim_free(p);
+		msg_start();
+		p = get_emsg_source();
+		if (p != NULL)
+		{
+		    STRCAT(p, "\n");
+		    redir_write(p, -1);
+		    vim_free(p);
+		}
+		p = get_emsg_lnum();
+		if (p != NULL)
+		{
+		    STRCAT(p, "\n");
+		    redir_write(p, -1);
+		    vim_free(p);
+		}
+		redir_write(s, -1);
 	    }
-	    p = get_emsg_lnum();
-	    if (p != NULL)
-	    {
-		STRCAT(p, "\n");
-		redir_write(p, -1);
-		vim_free(p);
-	    }
-	    redir_write(s, -1);
 	    return TRUE;
 	}
 
@@ -3063,8 +3066,8 @@ redir_write(char_u *str, int maxlen)
 	    while (cur_col < msg_col)
 	    {
 #ifdef FEAT_EVAL
-		if (redir_evalcmd)
-		    evalcmd_redir_str((char_u *)" ", -1);
+		if (redir_execute)
+		    execute_redir_str((char_u *)" ", -1);
 		else if (redir_reg)
 		    write_reg_contents(redir_reg, (char_u *)" ", -1, TRUE);
 		else if (redir_vname)
@@ -3080,8 +3083,8 @@ redir_write(char_u *str, int maxlen)
 	}
 
 #ifdef FEAT_EVAL
-	if (redir_evalcmd)
-	    evalcmd_redir_str(s, maxlen);
+	if (redir_execute)
+	    execute_redir_str(s, maxlen);
 	else if (redir_reg)
 	    write_reg_contents(redir_reg, s, maxlen, TRUE);
 	else if (redir_vname)
@@ -3092,7 +3095,7 @@ redir_write(char_u *str, int maxlen)
 	while (*s != NUL && (maxlen < 0 || (int)(s - str) < maxlen))
 	{
 #ifdef FEAT_EVAL
-	    if (!redir_reg && !redir_vname && !redir_evalcmd)
+	    if (!redir_reg && !redir_vname && !redir_execute)
 #endif
 		if (redir_fd != NULL)
 		    putc(*s, redir_fd);
@@ -3117,7 +3120,7 @@ redirecting(void)
 {
     return redir_fd != NULL || *p_vfile != NUL
 #ifdef FEAT_EVAL
-			  || redir_reg || redir_vname || redir_evalcmd
+			  || redir_reg || redir_vname || redir_execute
 #endif
 				       ;
 }