diff src/evalvars.c @ 26877:06a137af96f8 v8.2.3967

patch 8.2.3967: error messages are spread out Commit: https://github.com/vim/vim/commit/460ae5dfca31fa627531c263184849976755cf6b Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 1 14:19:49 2022 +0000 patch 8.2.3967: error messages are spread out Problem: Error messages are spread out. Solution: Move more errors to errors.h.
author Bram Moolenaar <Bram@vim.org>
date Sat, 01 Jan 2022 15:30:05 +0100
parents bce848ec8b1b
children fb67cd7d30a7
line wrap: on
line diff
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -955,7 +955,7 @@ ex_let_vars(
     // ":let [v1, v2] = list" or ":for [v1, v2] in listlist"
     if (tv->v_type != VAR_LIST || (l = tv->vval.v_list) == NULL)
     {
-	emsg(_(e_listreq));
+	emsg(_(e_list_required));
 	return FAIL;
     }
 
@@ -1320,7 +1320,7 @@ ex_let_env(
     else
     {
 	if (op != NULL && vim_strchr((char_u *)"+-*/%", *op) != NULL)
-	    semsg(_(e_letwrong), op);
+	    semsg(_(e_wrong_variable_type_for_str_equal), op);
 	else if (endchars != NULL
 			      && vim_strchr(endchars, *skipwhite(arg)) == NULL)
 	    emsg(_(e_unexpected_characters_in_let));
@@ -1374,7 +1374,7 @@ ex_let_option(
     if ((flags & (ASSIGN_CONST | ASSIGN_FINAL))
 					 && (flags & ASSIGN_FOR_LOOP) == 0)
     {
-	emsg(_(e_const_option));
+	emsg(_(e_cannot_lock_an_option));
 	return NULL;
     }
 
@@ -1434,7 +1434,7 @@ ex_let_option(
 	    if (((opt_type == gov_bool || opt_type == gov_number) && *op == '.')
 		    || (opt_type == gov_string && *op != '.'))
 	    {
-		semsg(_(e_letwrong), op);
+		semsg(_(e_wrong_variable_type_for_str_equal), op);
 		failed = TRUE;  // don't set the value
 
 	    }
@@ -1475,7 +1475,7 @@ ex_let_option(
 		arg_end = p;
 	    }
 	    else
-		emsg(_(e_stringreq));
+		emsg(_(e_string_required));
 	}
 	*p = c1;
 	vim_free(stringval);
@@ -1505,7 +1505,7 @@ ex_let_register(
     }
     ++arg;
     if (op != NULL && vim_strchr((char_u *)"+-*/%", *op) != NULL)
-	semsg(_(e_letwrong), op);
+	semsg(_(e_wrong_variable_type_for_str_equal), op);
     else if (endchars != NULL
 			  && vim_strchr(endchars, *skipwhite(arg + 1)) == NULL)
 	emsg(_(e_unexpected_characters_in_let));
@@ -3309,7 +3309,7 @@ set_var_const(
     ht = find_var_ht(name, &varname);
     if (ht == NULL || *varname == NUL)
     {
-	semsg(_(e_illvar), name);
+	semsg(_(e_illegal_variable_name_str), name);
 	goto failed;
     }
     is_script_local = ht == get_script_local_ht();
@@ -3403,7 +3403,7 @@ set_var_const(
 		if ((flags & (ASSIGN_CONST | ASSIGN_FINAL))
 					     && (flags & ASSIGN_FOR_LOOP) == 0)
 		{
-		    emsg(_(e_cannot_mod));
+		    emsg(_(e_cannot_modify_existing_variable));
 		    goto failed;
 		}
 
@@ -3518,7 +3518,7 @@ set_var_const(
 	    // Can't add "v:" or "a:" variable.
 	    if (ht == &vimvarht || ht == get_funccal_args_ht())
 	    {
-		semsg(_(e_illvar), name);
+		semsg(_(e_illegal_variable_name_str), name);
 		goto failed;
 	    }
 
@@ -3748,7 +3748,7 @@ valid_varname(char_u *varname, int len, 
 	if (!eval_isnamec1(*p) && (p == varname || !VIM_ISDIGIT(*p))
 					 && !(autoload && *p == AUTOLOAD_CHAR))
 	{
-	    semsg(_(e_illvar), varname);
+	    semsg(_(e_illegal_variable_name_str), varname);
 	    return FALSE;
 	}
     return TRUE;