Mercurial > vim
comparison src/vim9execute.c @ 26877:06a137af96f8 v8.2.3967
patch 8.2.3967: error messages are spread out
Commit: https://github.com/vim/vim/commit/460ae5dfca31fa627531c263184849976755cf6b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 1 14:19:49 2022 +0000
patch 8.2.3967: error messages are spread out
Problem: Error messages are spread out.
Solution: Move more errors to errors.h.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 01 Jan 2022 15:30:05 +0100 |
parents | bce848ec8b1b |
children | 7f150a4936f2 |
comparison
equal
deleted
inserted
replaced
26876:601a973ac16c | 26877:06a137af96f8 |
---|---|
269 int res = OK; | 269 int res = OK; |
270 | 270 |
271 if (dfunc->df_deleted) | 271 if (dfunc->df_deleted) |
272 { | 272 { |
273 // don't use ufunc->uf_name, it may have been freed | 273 // don't use ufunc->uf_name, it may have been freed |
274 emsg_funcname(e_func_deleted, | 274 emsg_funcname(e_function_was_deleted_str, |
275 dfunc->df_name == NULL ? (char_u *)"unknown" : dfunc->df_name); | 275 dfunc->df_name == NULL ? (char_u *)"unknown" : dfunc->df_name); |
276 return FAIL; | 276 return FAIL; |
277 } | 277 } |
278 | 278 |
279 #ifdef FEAT_PROFILE | 279 #ifdef FEAT_PROFILE |
2576 if (lidx < 0 && list->lv_len + lidx >= 0) | 2576 if (lidx < 0 && list->lv_len + lidx >= 0) |
2577 // negative index is relative to the end | 2577 // negative index is relative to the end |
2578 lidx = list->lv_len + lidx; | 2578 lidx = list->lv_len + lidx; |
2579 if (lidx < 0 || lidx > list->lv_len) | 2579 if (lidx < 0 || lidx > list->lv_len) |
2580 { | 2580 { |
2581 semsg(_(e_listidx), lidx); | 2581 semsg(_(e_list_index_out_of_range_nr), lidx); |
2582 goto on_error; | 2582 goto on_error; |
2583 } | 2583 } |
2584 if (lidx < list->lv_len) | 2584 if (lidx < list->lv_len) |
2585 { | 2585 { |
2586 listitem_T *li = list_find(list, lidx); | 2586 listitem_T *li = list_find(list, lidx); |
2657 lidx = len + lidx; | 2657 lidx = len + lidx; |
2658 | 2658 |
2659 // Can add one byte at the end. | 2659 // Can add one byte at the end. |
2660 if (lidx < 0 || lidx > len) | 2660 if (lidx < 0 || lidx > len) |
2661 { | 2661 { |
2662 semsg(_(e_blobidx), lidx); | 2662 semsg(_(e_blob_index_out_of_range_nr), lidx); |
2663 goto on_error; | 2663 goto on_error; |
2664 } | 2664 } |
2665 if (value_check_lock(blob->bv_lock, | 2665 if (value_check_lock(blob->bv_lock, |
2666 (char_u *)"blob", FALSE)) | 2666 (char_u *)"blob", FALSE)) |
2667 goto on_error; | 2667 goto on_error; |
2877 if (d != NULL) | 2877 if (d != NULL) |
2878 di = dict_find(d, key, (int)STRLEN(key)); | 2878 di = dict_find(d, key, (int)STRLEN(key)); |
2879 if (di == NULL) | 2879 if (di == NULL) |
2880 { | 2880 { |
2881 // NULL dict is equivalent to empty dict | 2881 // NULL dict is equivalent to empty dict |
2882 semsg(_(e_dictkey), key); | 2882 semsg(_(e_key_not_present_in_dictionary), key); |
2883 status = FAIL; | 2883 status = FAIL; |
2884 } | 2884 } |
2885 else if (var_check_fixed(di->di_flags, | 2885 else if (var_check_fixed(di->di_flags, |
2886 NULL, FALSE) | 2886 NULL, FALSE) |
2887 || var_check_ro(di->di_flags, | 2887 || var_check_ro(di->di_flags, |
2913 listitem_T *li = list_find(l, n); | 2913 listitem_T *li = list_find(l, n); |
2914 | 2914 |
2915 if (li == NULL) | 2915 if (li == NULL) |
2916 { | 2916 { |
2917 SOURCING_LNUM = iptr->isn_lnum; | 2917 SOURCING_LNUM = iptr->isn_lnum; |
2918 semsg(_(e_listidx), n); | 2918 semsg(_(e_list_index_out_of_range_nr), n); |
2919 status = FAIL; | 2919 status = FAIL; |
2920 } | 2920 } |
2921 else if (value_check_lock(li->li_tv.v_lock, | 2921 else if (value_check_lock(li->li_tv.v_lock, |
2922 NULL, FALSE)) | 2922 NULL, FALSE)) |
2923 status = FAIL; | 2923 status = FAIL; |
2989 } | 2989 } |
2990 if (status != FAIL | 2990 if (status != FAIL |
2991 && tv_idx2->v_type != VAR_SPECIAL | 2991 && tv_idx2->v_type != VAR_SPECIAL |
2992 && n2 < n1) | 2992 && n2 < n1) |
2993 { | 2993 { |
2994 semsg(_(e_listidx), n2); | 2994 semsg(_(e_list_index_out_of_range_nr), n2); |
2995 status = FAIL; | 2995 status = FAIL; |
2996 } | 2996 } |
2997 if (status != FAIL | 2997 if (status != FAIL |
2998 && list_unlet_range(l, li, NULL, n1, | 2998 && list_unlet_range(l, li, NULL, n1, |
2999 tv_idx2->v_type != VAR_SPECIAL, n2) | 2999 tv_idx2->v_type != VAR_SPECIAL, n2) |
4020 case EXPR_MULT: f1 = f1 * f2; break; | 4020 case EXPR_MULT: f1 = f1 * f2; break; |
4021 case EXPR_DIV: f1 = f1 / f2; break; | 4021 case EXPR_DIV: f1 = f1 / f2; break; |
4022 case EXPR_SUB: f1 = f1 - f2; break; | 4022 case EXPR_SUB: f1 = f1 - f2; break; |
4023 case EXPR_ADD: f1 = f1 + f2; break; | 4023 case EXPR_ADD: f1 = f1 + f2; break; |
4024 default: SOURCING_LNUM = iptr->isn_lnum; | 4024 default: SOURCING_LNUM = iptr->isn_lnum; |
4025 emsg(_(e_modulus)); | 4025 emsg(_(e_cannot_use_percent_with_float)); |
4026 goto on_error; | 4026 goto on_error; |
4027 } | 4027 } |
4028 clear_tv(tv1); | 4028 clear_tv(tv1); |
4029 clear_tv(tv2); | 4029 clear_tv(tv2); |
4030 tv1->v_type = VAR_FLOAT; | 4030 tv1->v_type = VAR_FLOAT; |
4247 key = (char_u *)""; | 4247 key = (char_u *)""; |
4248 | 4248 |
4249 if ((di = dict_find(dict, key, -1)) == NULL) | 4249 if ((di = dict_find(dict, key, -1)) == NULL) |
4250 { | 4250 { |
4251 SOURCING_LNUM = iptr->isn_lnum; | 4251 SOURCING_LNUM = iptr->isn_lnum; |
4252 semsg(_(e_dictkey), key); | 4252 semsg(_(e_key_not_present_in_dictionary), key); |
4253 | 4253 |
4254 // If :silent! is used we will continue, make sure the | 4254 // If :silent! is used we will continue, make sure the |
4255 // stack contents makes sense and the dict stack is | 4255 // stack contents makes sense and the dict stack is |
4256 // updated. | 4256 // updated. |
4257 clear_tv(tv); | 4257 clear_tv(tv); |
4281 | 4281 |
4282 tv = STACK_TV_BOT(-1); | 4282 tv = STACK_TV_BOT(-1); |
4283 if (tv->v_type != VAR_DICT || tv->vval.v_dict == NULL) | 4283 if (tv->v_type != VAR_DICT || tv->vval.v_dict == NULL) |
4284 { | 4284 { |
4285 SOURCING_LNUM = iptr->isn_lnum; | 4285 SOURCING_LNUM = iptr->isn_lnum; |
4286 emsg(_(e_dictreq)); | 4286 emsg(_(e_dictionary_required)); |
4287 goto on_error; | 4287 goto on_error; |
4288 } | 4288 } |
4289 dict = tv->vval.v_dict; | 4289 dict = tv->vval.v_dict; |
4290 | 4290 |
4291 if ((di = dict_find(dict, iptr->isn_arg.string, -1)) | 4291 if ((di = dict_find(dict, iptr->isn_arg.string, -1)) |
4292 == NULL) | 4292 == NULL) |
4293 { | 4293 { |
4294 SOURCING_LNUM = iptr->isn_lnum; | 4294 SOURCING_LNUM = iptr->isn_lnum; |
4295 semsg(_(e_dictkey), iptr->isn_arg.string); | 4295 semsg(_(e_key_not_present_in_dictionary), iptr->isn_arg.string); |
4296 goto on_error; | 4296 goto on_error; |
4297 } | 4297 } |
4298 // Put the dict used on the dict stack, it might be used by | 4298 // Put the dict used on the dict stack, it might be used by |
4299 // a dict function later. | 4299 // a dict function later. |
4300 if (dict_stack_save(tv) == FAIL) | 4300 if (dict_stack_save(tv) == FAIL) |