comparison src/vim9execute.c @ 31602:53c3df37a2b0 v9.0.1133

patch 9.0.1133: error message names do not match the items Commit: https://github.com/vim/vim/commit/a9fa8c58fbcc5cf8850f6963c509de272f4d4bbf Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 2 18:10:04 2023 +0000 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".
author Bram Moolenaar <Bram@vim.org>
date Mon, 02 Jan 2023 19:15:04 +0100
parents fc9ce07dc8a4
children 9b13b3a63bc0
comparison
equal deleted inserted replaced
31601:7282793ec66f 31602:53c3df37a2b0
227 for (idx = 0; idx < count; ++idx) 227 for (idx = 0; idx < count; ++idx)
228 { 228 {
229 // have already checked key type is VAR_STRING 229 // have already checked key type is VAR_STRING
230 tv = STACK_TV_BOT(2 * (idx - count)); 230 tv = STACK_TV_BOT(2 * (idx - count));
231 // check key is unique 231 // check key is unique
232 key = tv->vval.v_string == NULL 232 key = tv->vval.v_string == NULL ? (char_u *)"" : tv->vval.v_string;
233 ? (char_u *)"" : tv->vval.v_string;
234 item = dict_find(dict, key, -1); 233 item = dict_find(dict, key, -1);
235 if (item != NULL) 234 if (item != NULL)
236 { 235 {
237 semsg(_(e_duplicate_key_in_dictionary), key); 236 semsg(_(e_duplicate_key_in_dictionary_str), key);
238 dict_unref(dict); 237 dict_unref(dict);
239 return MAYBE; 238 return MAYBE;
240 } 239 }
241 item = dictitem_alloc(key); 240 item = dictitem_alloc(key);
242 clear_tv(tv); 241 clear_tv(tv);
2384 if (d != NULL) 2383 if (d != NULL)
2385 di = dict_find(d, key, (int)STRLEN(key)); 2384 di = dict_find(d, key, (int)STRLEN(key));
2386 if (di == NULL) 2385 if (di == NULL)
2387 { 2386 {
2388 // NULL dict is equivalent to empty dict 2387 // NULL dict is equivalent to empty dict
2389 semsg(_(e_key_not_present_in_dictionary), 2388 semsg(_(e_key_not_present_in_dictionary_str), key);
2390 key);
2391 status = FAIL; 2389 status = FAIL;
2392 } 2390 }
2393 else if (var_check_fixed(di->di_flags, 2391 else if (var_check_fixed(di->di_flags,
2394 NULL, FALSE) 2392 NULL, FALSE)
2395 || var_check_ro(di->di_flags, 2393 || var_check_ro(di->di_flags,
5101 key = (char_u *)""; 5099 key = (char_u *)"";
5102 5100
5103 if ((di = dict_find(dict, key, -1)) == NULL) 5101 if ((di = dict_find(dict, key, -1)) == NULL)
5104 { 5102 {
5105 SOURCING_LNUM = iptr->isn_lnum; 5103 SOURCING_LNUM = iptr->isn_lnum;
5106 semsg(_(e_key_not_present_in_dictionary), key); 5104 semsg(_(e_key_not_present_in_dictionary_str), key);
5107 5105
5108 // If :silent! is used we will continue, make sure the 5106 // If :silent! is used we will continue, make sure the
5109 // stack contents makes sense and the dict stack is 5107 // stack contents makes sense and the dict stack is
5110 // updated. 5108 // updated.
5111 clear_tv(tv); 5109 clear_tv(tv);
5144 5142
5145 if ((di = dict_find(dict, iptr->isn_arg.string, -1)) 5143 if ((di = dict_find(dict, iptr->isn_arg.string, -1))
5146 == NULL) 5144 == NULL)
5147 { 5145 {
5148 SOURCING_LNUM = iptr->isn_lnum; 5146 SOURCING_LNUM = iptr->isn_lnum;
5149 semsg(_(e_key_not_present_in_dictionary), 5147 semsg(_(e_key_not_present_in_dictionary_str),
5150 iptr->isn_arg.string); 5148 iptr->isn_arg.string);
5151 goto on_error; 5149 goto on_error;
5152 } 5150 }
5153 // Put the dict used on the dict stack, it might be used by 5151 // Put the dict used on the dict stack, it might be used by
5154 // a dict function later. 5152 // a dict function later.