Skip to content

Commit a9fa8c5

Browse files
committed
patch 9.0.1133: error message names do not match the items
Problem: Error message names do not match the items. Solution: Add "_str" when the text contains "%s".
1 parent dc4daa3 commit a9fa8c5

16 files changed

Lines changed: 62 additions & 59 deletions

src/dict.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
982982
if (*skipwhite(*arg) == ':')
983983
semsg(_(e_no_white_space_allowed_before_str_str), ":", *arg);
984984
else
985-
semsg(_(e_missing_colon_in_dictionary), *arg);
985+
semsg(_(e_missing_colon_in_dictionary_str), *arg);
986986
clear_tv(&tvkey);
987987
goto failret;
988988
}
@@ -1020,7 +1020,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
10201020
item = dict_find(d, key, -1);
10211021
if (item != NULL)
10221022
{
1023-
semsg(_(e_duplicate_key_in_dictionary), key);
1023+
semsg(_(e_duplicate_key_in_dictionary_str), key);
10241024
clear_tv(&tvkey);
10251025
clear_tv(&tv);
10261026
goto failret;
@@ -1060,15 +1060,15 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
10601060
if (**arg == ',')
10611061
semsg(_(e_no_white_space_allowed_before_str_str), ",", *arg);
10621062
else
1063-
semsg(_(e_missing_comma_in_dictionary), *arg);
1063+
semsg(_(e_missing_comma_in_dictionary_str), *arg);
10641064
goto failret;
10651065
}
10661066
}
10671067

10681068
if (**arg != '}')
10691069
{
10701070
if (evalarg != NULL)
1071-
semsg(_(e_missing_dict_end), *arg);
1071+
semsg(_(e_missing_dict_end_str), *arg);
10721072
failret:
10731073
if (d != NULL)
10741074
dict_free(d);
@@ -1456,7 +1456,7 @@ dict_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg)
14561456
di = dict_find(d, key, -1);
14571457
if (di == NULL)
14581458
{
1459-
semsg(_(e_key_not_present_in_dictionary), key);
1459+
semsg(_(e_key_not_present_in_dictionary_str), key);
14601460
return;
14611461
}
14621462

src/errors.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -968,9 +968,9 @@ EXTERN char e_couldnt_find_pattern[]
968968
#ifdef FEAT_SYN_HL
969969
EXTERN char e_illegal_argument_str_2[]
970970
INIT(= N_("E390: Illegal argument: %s"));
971-
EXTERN char e_no_such_syntax_cluster_1[]
971+
EXTERN char e_no_such_syntax_cluster_str_1[]
972972
INIT(= N_("E391: No such syntax cluster: %s"));
973-
EXTERN char e_no_such_syntax_cluster_2[]
973+
EXTERN char e_no_such_syntax_cluster_str_2[]
974974
INIT(= N_("E392: No such syntax cluster: %s"));
975975
EXTERN char e_groupthere_not_accepted_here[]
976976
INIT(= N_("E393: group[t]here not accepted here"));
@@ -1028,7 +1028,7 @@ EXTERN char e_fg_color_unknown[]
10281028
INIT(= N_("E419: FG color unknown"));
10291029
EXTERN char e_bg_color_unknown[]
10301030
INIT(= N_("E420: BG color unknown"));
1031-
EXTERN char e_color_name_or_number_not_recognized[]
1031+
EXTERN char e_color_name_or_number_not_recognized_str[]
10321032
INIT(= N_("E421: Color name or number not recognized: %s"));
10331033
EXTERN char e_terminal_code_too_long_str[]
10341034
INIT(= N_("E422: Terminal code too long: %s"));
@@ -1796,21 +1796,21 @@ EXTERN char e_list_required[]
17961796
INIT(= N_("E714: List required"));
17971797
EXTERN char e_dictionary_required[]
17981798
INIT(= N_("E715: Dictionary required"));
1799-
EXTERN char e_key_not_present_in_dictionary[]
1799+
EXTERN char e_key_not_present_in_dictionary_str[]
18001800
INIT(= N_("E716: Key not present in Dictionary: \"%s\""));
18011801
EXTERN char e_dictionary_entry_already_exists[]
18021802
INIT(= N_("E717: Dictionary entry already exists"));
18031803
EXTERN char e_funcref_required[]
18041804
INIT(= N_("E718: Funcref required"));
18051805
EXTERN char e_cannot_slice_dictionary[]
18061806
INIT(= N_("E719: Cannot slice a Dictionary"));
1807-
EXTERN char e_missing_colon_in_dictionary[]
1807+
EXTERN char e_missing_colon_in_dictionary_str[]
18081808
INIT(= N_("E720: Missing colon in Dictionary: %s"));
1809-
EXTERN char e_duplicate_key_in_dictionary[]
1809+
EXTERN char e_duplicate_key_in_dictionary_str[]
18101810
INIT(= N_("E721: Duplicate key in Dictionary: \"%s\""));
1811-
EXTERN char e_missing_comma_in_dictionary[]
1811+
EXTERN char e_missing_comma_in_dictionary_str[]
18121812
INIT(= N_("E722: Missing comma in Dictionary: %s"));
1813-
EXTERN char e_missing_dict_end[]
1813+
EXTERN char e_missing_dict_end_str[]
18141814
INIT(= N_("E723: Missing end of Dictionary '}': %s"));
18151815
EXTERN char e_variable_nested_too_deep_for_displaying[]
18161816
INIT(= N_("E724: Variable nested too deep for displaying"));
@@ -2111,7 +2111,7 @@ EXTERN char e_undo_number_nr_not_found[]
21112111
EXTERN char e_bf_key_init_called_with_empty_password[]
21122112
INIT(= N_("E831: bf_key_init() called with empty password"));
21132113
# ifdef FEAT_PERSISTENT_UNDO
2114-
EXTERN char e_non_encrypted_file_has_encrypted_undo_file[]
2114+
EXTERN char e_non_encrypted_file_has_encrypted_undo_file_str[]
21152115
INIT(= N_("E832: Non-encrypted file has encrypted undo file: %s"));
21162116
# endif
21172117
#else
@@ -2397,7 +2397,7 @@ EXTERN char e_cannot_use_redir_inside_execute[]
23972397
EXTERN char e_buffer_cannot_be_registered[]
23982398
INIT(= N_("E931: Buffer cannot be registered"));
23992399
#ifdef FEAT_EVAL
2400-
EXTERN char e_closure_function_should_not_be_at_top_level[]
2400+
EXTERN char e_closure_function_should_not_be_at_top_level_str[]
24012401
INIT(= N_("E932: Closure function should not be at top level: %s"));
24022402
EXTERN char e_function_was_deleted_str[]
24032403
INIT(= N_("E933: Function was deleted: %s"));
@@ -2513,7 +2513,7 @@ EXTERN char e_property_type_str_already_defined[]
25132513
INIT(= N_("E969: Property type %s already defined"));
25142514
EXTERN char e_unknown_highlight_group_name_str[]
25152515
INIT(= N_("E970: Unknown highlight group name: '%s'"));
2516-
EXTERN char e_type_not_exist[]
2516+
EXTERN char e_property_type_str_does_not_exist[]
25172517
INIT(= N_("E971: Property type %s does not exist"));
25182518
#endif
25192519
#ifdef FEAT_EVAL
@@ -2634,17 +2634,17 @@ EXTERN char e_invalid_key_str[]
26342634
INIT(= N_("E1014: Invalid key: %s"));
26352635
EXTERN char e_name_expected_str[]
26362636
INIT(= N_("E1015: Name expected: %s"));
2637-
EXTERN char e_cannot_declare_a_scope_variable[]
2637+
EXTERN char e_cannot_declare_a_scope_variable_str[]
26382638
INIT(= N_("E1016: Cannot declare a %s variable: %s"));
2639-
EXTERN char e_cannot_declare_an_environment_variable[]
2639+
EXTERN char e_cannot_declare_an_environment_variable_str[]
26402640
INIT(= N_("E1016: Cannot declare an environment variable: %s"));
2641-
EXTERN char e_variable_already_declared[]
2641+
EXTERN char e_variable_already_declared_str[]
26422642
INIT(= N_("E1017: Variable already declared: %s"));
2643-
EXTERN char e_cannot_assign_to_constant[]
2643+
EXTERN char e_cannot_assign_to_constant_str[]
26442644
INIT(= N_("E1018: Cannot assign to a constant: %s"));
26452645
EXTERN char e_can_only_concatenate_to_string[]
26462646
INIT(= N_("E1019: Can only concatenate to string"));
2647-
EXTERN char e_cannot_use_operator_on_new_variable[]
2647+
EXTERN char e_cannot_use_operator_on_new_variable_str[]
26482648
INIT(= N_("E1020: Cannot use an operator on a new variable: %s"));
26492649
EXTERN char e_const_requires_a_value[]
26502650
INIT(= N_("E1021: Const requires a value"));
@@ -2674,7 +2674,7 @@ EXTERN char e_missing_catch_or_finally[]
26742674
INIT(= N_("E1032: Missing :catch or :finally"));
26752675
EXTERN char e_catch_unreachable_after_catch_all[]
26762676
INIT(= N_("E1033: Catch unreachable after catch-all"));
2677-
EXTERN char e_cannot_use_reserved_name[]
2677+
EXTERN char e_cannot_use_reserved_name_str[]
26782678
INIT(= N_("E1034: Cannot use reserved name %s"));
26792679
EXTERN char e_percent_requires_number_arguments[]
26802680
// xgettext:no-c-format
@@ -2713,7 +2713,7 @@ EXTERN char e_colon_required_before_range_str[]
27132713
#ifdef FEAT_EVAL
27142714
EXTERN char e_wrong_argument_type_for_plus[]
27152715
INIT(= N_("E1051: Wrong argument type for +"));
2716-
EXTERN char e_cannot_declare_an_option[]
2716+
EXTERN char e_cannot_declare_an_option_str[]
27172717
INIT(= N_("E1052: Cannot declare an option: %s"));
27182718
EXTERN char e_could_not_import_str[]
27192719
INIT(= N_("E1053: Could not import \"%s\""));
@@ -2791,7 +2791,7 @@ EXTERN char e_script_cannot_import_itself[]
27912791
INIT(= N_("E1088: Script cannot import itself"));
27922792
EXTERN char e_unknown_variable_str[]
27932793
INIT(= N_("E1089: Unknown variable: %s"));
2794-
EXTERN char e_cannot_assign_to_argument[]
2794+
EXTERN char e_cannot_assign_to_argument_str[]
27952795
INIT(= N_("E1090: Cannot assign to argument %s"));
27962796
EXTERN char e_function_is_not_compiled_str[]
27972797
INIT(= N_("E1091: Function is not compiled: %s"));

src/eval.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ get_lval(
11831183
if (vim9script && (flags & GLV_NO_DECL) == 0)
11841184
{
11851185
if (!quiet)
1186-
semsg(_(e_variable_already_declared), lp->ll_name);
1186+
semsg(_(e_variable_already_declared_str), lp->ll_name);
11871187
return NULL;
11881188
}
11891189

@@ -1413,7 +1413,7 @@ get_lval(
14131413
if (*p == '[' || *p == '.' || unlet)
14141414
{
14151415
if (!quiet)
1416-
semsg(_(e_key_not_present_in_dictionary), key);
1416+
semsg(_(e_key_not_present_in_dictionary_str), key);
14171417
clear_tv(&var1);
14181418
return NULL;
14191419
}
@@ -1717,7 +1717,7 @@ set_var_lval(
17171717
{
17181718
if (op != NULL && *op != '=')
17191719
{
1720-
semsg(_(e_key_not_present_in_dictionary), lp->ll_newkey);
1720+
semsg(_(e_key_not_present_in_dictionary_str), lp->ll_newkey);
17211721
return;
17221722
}
17231723
if (dict_wrong_func_name(lp->ll_tv->vval.v_dict, rettv,
@@ -4968,7 +4968,7 @@ eval_index_inner(
49684968
{
49694969
if (keylen > 0)
49704970
key[keylen] = NUL;
4971-
semsg(_(e_key_not_present_in_dictionary), key);
4971+
semsg(_(e_key_not_present_in_dictionary_str), key);
49724972
}
49734973
return FAIL;
49744974
}

src/evalfunc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7200,7 +7200,7 @@ f_islocked(typval_T *argvars, typval_T *rettv)
72007200
else if (lv.ll_range)
72017201
emsg(_(e_range_not_allowed));
72027202
else if (lv.ll_newkey != NULL)
7203-
semsg(_(e_key_not_present_in_dictionary), lv.ll_newkey);
7203+
semsg(_(e_key_not_present_in_dictionary_str), lv.ll_newkey);
72047204
else if (lv.ll_list != NULL)
72057205
// List item.
72067206
rettv->vval.v_number = tv_islocked(&lv.ll_li->li_tv);

src/evalvars.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,8 @@ ex_let(exarg_T *eap)
11111111
if (vim9script && (flags & ASSIGN_NO_DECL) == 0)
11121112
{
11131113
// +=, /=, etc. require an existing variable
1114-
semsg(_(e_cannot_use_operator_on_new_variable), eap->arg);
1114+
semsg(_(e_cannot_use_operator_on_new_variable_str),
1115+
eap->arg);
11151116
}
11161117
else if (vim_strchr((char_u *)"+-*/%.", *expr) != NULL)
11171118
{

src/highlight.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ highlight_set_cterm_color(
10911091
break;
10921092
if (i < 0)
10931093
{
1094-
semsg(_(e_color_name_or_number_not_recognized), key_start);
1094+
semsg(_(e_color_name_or_number_not_recognized_str), key_start);
10951095
return FALSE;
10961096
}
10971097

src/syntax.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3670,7 +3670,7 @@ syn_cmd_clear(exarg_T *eap, int syncing)
36703670
id = syn_scl_namen2id(arg + 1, (int)(arg_end - arg - 1));
36713671
if (id == 0)
36723672
{
3673-
semsg(_(e_no_such_syntax_cluster_1), arg);
3673+
semsg(_(e_no_such_syntax_cluster_str_1), arg);
36743674
break;
36753675
}
36763676
else
@@ -3880,7 +3880,7 @@ syn_cmd_list(
38803880
{
38813881
id = syn_scl_namen2id(arg + 1, (int)(arg_end - arg - 1));
38823882
if (id == 0)
3883-
semsg(_(e_no_such_syntax_cluster_2), arg);
3883+
semsg(_(e_no_such_syntax_cluster_str_2), arg);
38843884
else
38853885
syn_list_cluster(id - SYNID_CLUSTER);
38863886
}

src/textprop.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ lookup_prop_type(char_u *name, buf_T *buf)
9898
if (type == NULL)
9999
type = find_prop_type(name, NULL);
100100
if (type == NULL)
101-
semsg(_(e_type_not_exist), name);
101+
semsg(_(e_property_type_str_does_not_exist), name);
102102
return type;
103103
}
104104

@@ -1825,7 +1825,7 @@ prop_type_set(typval_T *argvars, int add)
18251825
{
18261826
if (prop == NULL)
18271827
{
1828-
semsg(_(e_type_not_exist), name);
1828+
semsg(_(e_property_type_str_does_not_exist), name);
18291829
return;
18301830
}
18311831
}

src/undo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1923,7 +1923,8 @@ u_read_undo(char_u *name, char_u *hash, char_u *orig_name UNUSED)
19231923
#ifdef FEAT_CRYPT
19241924
if (*curbuf->b_p_key == NUL)
19251925
{
1926-
semsg(_(e_non_encrypted_file_has_encrypted_undo_file), file_name);
1926+
semsg(_(e_non_encrypted_file_has_encrypted_undo_file_str),
1927+
file_name);
19271928
goto error;
19281929
}
19291930
bi.bi_state = crypt_create_from_file(fp, curbuf->b_p_key);

src/userfunc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4599,7 +4599,8 @@ define_function(
45994599
if (!aborting())
46004600
{
46014601
if (!eap->skip && fudi.fd_newkey != NULL)
4602-
semsg(_(e_key_not_present_in_dictionary), fudi.fd_newkey);
4602+
semsg(_(e_key_not_present_in_dictionary_str),
4603+
fudi.fd_newkey);
46034604
vim_free(fudi.fd_newkey);
46044605
return NULL;
46054606
}
@@ -4847,7 +4848,7 @@ define_function(
48474848
p += 7;
48484849
if (current_funccal == NULL)
48494850
{
4850-
emsg_funcname(e_closure_function_should_not_be_at_top_level,
4851+
emsg_funcname(e_closure_function_should_not_be_at_top_level_str,
48514852
name == NULL ? (char_u *)"" : name);
48524853
goto erret;
48534854
}
@@ -6058,7 +6059,7 @@ ex_call(exarg_T *eap)
60586059
if (fudi.fd_newkey != NULL)
60596060
{
60606061
// Still need to give an error message for missing key.
6061-
semsg(_(e_key_not_present_in_dictionary), fudi.fd_newkey);
6062+
semsg(_(e_key_not_present_in_dictionary_str), fudi.fd_newkey);
60626063
vim_free(fudi.fd_newkey);
60636064
}
60646065
if (tofree == NULL)

0 commit comments

Comments
 (0)