diff src/evalvars.c @ 25611:f142bfebaac1 v8.2.3342

patch 8.2.3342: test for :let errors fails Commit: https://github.com/vim/vim/commit/b521766c56c0e17db6e8615f35cf21012af0670c Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 14 14:27:30 2021 +0200 patch 8.2.3342: test for :let errors fails Problem: Test for :let errors fails. Solution: Adjust the test and how to avoid a second error message.
author Bram Moolenaar <Bram@vim.org>
date Sat, 14 Aug 2021 14:30:04 +0200
parents f8bcd21e6e24
children 994cad298596
line wrap: on
line diff
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -1184,6 +1184,7 @@ list_arg_vars(exarg_T *eap, char_u *arg,
     char_u	*arg_subsc;
     char_u	*tofree;
     typval_T    tv;
+    int		prev_uncaught_emsg = uncaught_emsg;
 
     while (!ends_excmd2(eap->cmd, arg) && !got_int)
     {
@@ -1193,7 +1194,7 @@ list_arg_vars(exarg_T *eap, char_u *arg,
 	    if (!VIM_ISWHITE(*arg) && !ends_excmd(*arg))
 	    {
 		emsg_severe = TRUE;
-		if (!error)
+		if (uncaught_emsg == prev_uncaught_emsg)
 		    semsg(_(e_trailing_arg), arg);
 		break;
 	    }