patch 8.2.3967: error messages are spread out
Problem: Error messages are spread out.
Solution: Move more errors to errors.h.
diff --git a/src/evalvars.c b/src/evalvars.c
index 381bda4..324355b 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -955,7 +955,7 @@
// ":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 @@
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 @@
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 @@
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 @@
arg_end = p;
}
else
- emsg(_(e_stringreq));
+ emsg(_(e_string_required));
}
*p = c1;
vim_free(stringval);
@@ -1505,7 +1505,7 @@
}
++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 @@
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 @@
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 @@
// 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 @@
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;