diff src/message.c @ 9436:f048e5a27253 v7.4.1999

commit https://github.com/vim/vim/commit/bc5d6dd1dd1dc3a06e4e655fc9479529db288365 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jul 7 23:04:18 2016 +0200 patch 7.4.1999 Problem: evalcmd() doesn't work recursively. Solution: Use redir_evalcmd instead of redir_vname.
author Christian Brabandt <cb@256bit.org>
date Thu, 07 Jul 2016 23:15:05 +0200
parents 32e34e574716
children 9da0cb39cbee
line wrap: on
line diff
--- a/src/message.c
+++ b/src/message.c
@@ -3063,7 +3063,9 @@ redir_write(char_u *str, int maxlen)
 	    while (cur_col < msg_col)
 	    {
 #ifdef FEAT_EVAL
-		if (redir_reg)
+		if (redir_evalcmd)
+		    evalcmd_redir_str((char_u *)" ", -1);
+		else if (redir_reg)
 		    write_reg_contents(redir_reg, (char_u *)" ", -1, TRUE);
 		else if (redir_vname)
 		    var_redir_str((char_u *)" ", -1);
@@ -3078,9 +3080,11 @@ redir_write(char_u *str, int maxlen)
 	}
 
 #ifdef FEAT_EVAL
-	if (redir_reg)
+	if (redir_evalcmd)
+	    evalcmd_redir_str(s, maxlen);
+	else if (redir_reg)
 	    write_reg_contents(redir_reg, s, maxlen, TRUE);
-	if (redir_vname)
+	else if (redir_vname)
 	    var_redir_str(s, maxlen);
 #endif
 
@@ -3088,7 +3092,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)
+	    if (!redir_reg && !redir_vname && !redir_evalcmd)
 #endif
 		if (redir_fd != NULL)
 		    putc(*s, redir_fd);
@@ -3113,7 +3117,7 @@ redirecting(void)
 {
     return redir_fd != NULL || *p_vfile != NUL
 #ifdef FEAT_EVAL
-			  || redir_reg || redir_vname
+			  || redir_reg || redir_vname || redir_evalcmd
 #endif
 				       ;
 }