patch 8.2.4005: error messages are spread out
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
diff --git a/src/typval.c b/src/typval.c
index be3a7b8..2ffc4ab 100644
--- a/src/typval.c
+++ b/src/typval.c
@@ -196,7 +196,7 @@
#endif
case VAR_FUNC:
case VAR_PARTIAL:
- emsg(_("E703: Using a Funcref as a Number"));
+ emsg(_(e_using_funcref_as_number));
break;
case VAR_STRING:
if (in_vim9script())
@@ -212,7 +212,7 @@
emsg(_("E745: Using a List as a Number"));
break;
case VAR_DICT:
- emsg(_("E728: Using a Dictionary as a Number"));
+ emsg(_(e_using_dictionary_as_number));
break;
case VAR_BOOL:
case VAR_SPECIAL:
@@ -927,13 +927,13 @@
return buf;
case VAR_FUNC:
case VAR_PARTIAL:
- emsg(_("E729: Using a Funcref as a String"));
+ emsg(_(e_using_funcref_as_string));
break;
case VAR_LIST:
- emsg(_("E730: Using a List as a String"));
+ emsg(_(e_using_list_as_string));
break;
case VAR_DICT:
- emsg(_("E731: Using a Dictionary as a String"));
+ emsg(_(e_using_dictionary_as_string));
break;
case VAR_FLOAT:
#ifdef FEAT_FLOAT
@@ -1345,9 +1345,9 @@
|| (type != EXPR_EQUAL && type != EXPR_NEQUAL))
{
if (tv1->v_type != tv2->v_type)
- emsg(_("E691: Can only compare List with List"));
+ emsg(_(e_can_only_compare_list_with_list));
else
- emsg(_("E692: Invalid operation for List"));
+ emsg(_(e_invalid_operation_for_list));
return FAIL;
}
else
@@ -1427,9 +1427,9 @@
|| (type != EXPR_EQUAL && type != EXPR_NEQUAL))
{
if (tv1->v_type != tv2->v_type)
- emsg(_("E735: Can only compare Dictionary with Dictionary"));
+ emsg(_(e_can_only_compare_dictionary_with_dictionary));
else
- emsg(_("E736: Invalid operation for Dictionary"));
+ emsg(_(e_invalid_operation_for_dictionary));
return FAIL;
}
else
@@ -1460,7 +1460,7 @@
if (type != EXPR_EQUAL && type != EXPR_NEQUAL
&& type != EXPR_IS && type != EXPR_ISNOT)
{
- emsg(_("E694: Invalid operation for Funcrefs"));
+ emsg(_(e_invalid_operation_for_funcrefs));
return FAIL;
}
if ((tv1->v_type == VAR_PARTIAL && tv1->vval.v_partial == NULL)