diff src/evalvars.c @ 21461:4dfd00f481fb v8.2.1281

patch 8.2.1281: the "trailing characters" error can be hard to understand Commit: https://github.com/vim/vim/commit/2d06bfde29bd3a62fc85823d2aa719ef943bd319 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jul 23 17:16:18 2020 +0200 patch 8.2.1281: the "trailing characters" error can be hard to understand Problem: The "trailing characters" error can be hard to understand. Solution: Add the trailing characters to the message.
author Bram Moolenaar <Bram@vim.org>
date Thu, 23 Jul 2020 17:30:03 +0200
parents 369cde0d5771
children 574517d682cf
line wrap: on
line diff
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -592,7 +592,7 @@ heredoc_get(exarg_T *eap, char_u *cmd, i
 	p = skiptowhite(marker);
 	if (*skipwhite(p) != NUL && *skipwhite(p) != '"')
 	{
-	    emsg(_(e_trailing));
+	    semsg(_(e_trailing_arg), p);
 	    return NULL;
 	}
 	*p = NUL;
@@ -1113,7 +1113,7 @@ list_arg_vars(exarg_T *eap, char_u *arg,
 	    if (!VIM_ISWHITE(*arg) && !ends_excmd(*arg))
 	    {
 		emsg_severe = TRUE;
-		emsg(_(e_trailing));
+		semsg(_(e_trailing_arg), arg);
 		break;
 	    }
 	}
@@ -1489,7 +1489,7 @@ ex_unletlock(
 		if (name_end != NULL)
 		{
 		    emsg_severe = TRUE;
-		    emsg(_(e_trailing));
+		    semsg(_(e_trailing_arg), name_end);
 		}
 		if (!(eap->skip || error))
 		    clear_lval(&lv);
@@ -3431,9 +3431,9 @@ var_redir_start(char_u *name, int append
 	clear_lval(redir_lval);
 	if (redir_endp != NULL && *redir_endp != NUL)
 	    // Trailing characters are present after the variable name
-	    emsg(_(e_trailing));
+	    semsg(_(e_trailing_arg), redir_endp);
 	else
-	    emsg(_(e_invarg));
+	    semsg(_(e_invarg2), name);
 	redir_endp = NULL;  // don't store a value, only cleanup
 	var_redir_stop();
 	return FAIL;