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/list.c b/src/list.c
index 42f9765..fe8c082 100644
--- a/src/list.c
+++ b/src/list.c
@@ -524,7 +524,7 @@
li = list_find(l, idx - 1);
if (li == NULL)
{
- semsg(_(e_listidx), idx);
+ semsg(_(e_list_index_out_of_range_nr), idx);
return NULL;
}
return tv_get_string(&li->li_tv);
@@ -782,7 +782,7 @@
if (li == NULL)
{
if (!quiet)
- semsg(_(e_listidx), *n1);
+ semsg(_(e_list_index_out_of_range_nr), *n1);
return NULL;
}
}
@@ -810,7 +810,7 @@
if (ni == NULL)
{
if (!quiet)
- semsg(_(e_listidx), *n2);
+ semsg(_(e_list_index_out_of_range_nr), *n2);
return FAIL;
}
*n2 = list_idx_of_item(l, ni);
@@ -822,7 +822,7 @@
if (*n2 < *n1)
{
if (!quiet)
- semsg(_(e_listidx), *n2);
+ semsg(_(e_list_index_out_of_range_nr), *n2);
return FAIL;
}
return OK;
@@ -1163,7 +1163,7 @@
if (!range)
{
if (verbose)
- semsg(_(e_listidx), (long)n1_arg);
+ semsg(_(e_list_index_out_of_range_nr), (long)n1_arg);
return FAIL;
}
if (in_vim9script())
@@ -1449,7 +1449,7 @@
if (argvars[0].v_type != VAR_LIST)
{
- emsg(_(e_listreq));
+ emsg(_(e_list_required));
return;
}
rettv->v_type = VAR_STRING;
@@ -1551,7 +1551,7 @@
if (**arg != ']')
{
if (do_error)
- semsg(_(e_list_end), *arg);
+ semsg(_(e_missing_end_of_list_rsb_str), *arg);
failret:
if (evaluate)
list_free(l);
@@ -1725,7 +1725,7 @@
if ((item = list_find(l, idx)) == NULL)
{
- semsg(_(e_listidx), idx);
+ semsg(_(e_list_index_out_of_range_nr), idx);
return;
}
@@ -1745,7 +1745,7 @@
if ((item2 = list_find(l, end)) == NULL)
{
- semsg(_(e_listidx), end);
+ semsg(_(e_list_index_out_of_range_nr), end);
return;
}
@@ -2174,7 +2174,7 @@
// optional third argument: {dict}
if (argvars[2].v_type != VAR_DICT)
{
- emsg(_(e_dictreq));
+ emsg(_(e_dictionary_required));
return FAIL;
}
info->item_compare_selfdict = argvars[2].vval.v_dict;
@@ -2598,7 +2598,7 @@
else if (argvars[0].v_type == VAR_BLOB)
blob_add(argvars, rettv);
else
- emsg(_(e_listblobreq));
+ emsg(_(e_list_or_blob_required));
}
/*
@@ -2622,7 +2622,7 @@
li = list_find(l, idx);
if (li == NULL)
{
- semsg(_(e_listidx), idx);
+ semsg(_(e_list_index_out_of_range_nr), idx);
return 0;
}
@@ -2675,7 +2675,7 @@
n = dict_count(argvars[0].vval.v_dict, &argvars[1], ic);
}
else
- semsg(_(e_listdictarg), "count()");
+ semsg(_(e_argument_of_str_must_be_list_or_dictionary), "count()");
rettv->vval.v_number = n;
}
@@ -2728,7 +2728,7 @@
item = list_find(l1, before);
if (item == NULL)
{
- semsg(_(e_listidx), before);
+ semsg(_(e_list_index_out_of_range_nr), before);
return;
}
}
@@ -2773,7 +2773,7 @@
else if (argvars[0].v_type == VAR_DICT && argvars[1].v_type == VAR_DICT)
dict_extend_func(argvars, type, func_name, arg_errmsg, is_new, rettv);
else
- semsg(_(e_listdictarg), func_name);
+ semsg(_(e_argument_of_str_must_be_list_or_dictionary), func_name);
if (type != NULL)
clear_type_list(&type_list);
@@ -2833,7 +2833,7 @@
item = list_find(l, before);
if (item == NULL)
{
- semsg(_(e_listidx), before);
+ semsg(_(e_list_index_out_of_range_nr), before);
l = NULL;
}
}
@@ -2890,7 +2890,7 @@
else if (argvars[0].v_type == VAR_LIST)
list_remove(argvars, rettv, arg_errmsg);
else
- semsg(_(e_listdictblobarg), "remove()");
+ semsg(_(e_argument_of_str_must_be_list_dictionary_or_blob), "remove()");
}
static void
@@ -2969,7 +2969,7 @@
{
if (l == NULL || l->lv_first == NULL)
{
- semsg(_(e_reduceempty), "List");
+ semsg(_(e_reduce_of_an_empty_str_with_no_initial_value), "List");
return;
}
initial = l->lv_first->li_tv;