Mercurial > vim
comparison src/userfunc.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 |
---|---|
3269 case FCERR_NOTMETHOD: | 3269 case FCERR_NOTMETHOD: |
3270 emsg_funcname( | 3270 emsg_funcname( |
3271 N_("E276: Cannot use function as a method: %s"), name); | 3271 N_("E276: Cannot use function as a method: %s"), name); |
3272 break; | 3272 break; |
3273 case FCERR_DELETED: | 3273 case FCERR_DELETED: |
3274 emsg_funcname(e_func_deleted, name); | 3274 emsg_funcname(e_function_was_deleted_str, name); |
3275 break; | 3275 break; |
3276 case FCERR_TOOMANY: | 3276 case FCERR_TOOMANY: |
3277 emsg_funcname((char *)e_too_many_arguments_for_function_str, | 3277 emsg_funcname((char *)e_too_many_arguments_for_function_str, |
3278 name); | 3278 name); |
3279 break; | 3279 break; |
4125 * interrupt, or an exception. | 4125 * interrupt, or an exception. |
4126 */ | 4126 */ |
4127 if (!aborting()) | 4127 if (!aborting()) |
4128 { | 4128 { |
4129 if (!eap->skip && fudi.fd_newkey != NULL) | 4129 if (!eap->skip && fudi.fd_newkey != NULL) |
4130 semsg(_(e_dictkey), fudi.fd_newkey); | 4130 semsg(_(e_key_not_present_in_dictionary), fudi.fd_newkey); |
4131 vim_free(fudi.fd_newkey); | 4131 vim_free(fudi.fd_newkey); |
4132 return NULL; | 4132 return NULL; |
4133 } | 4133 } |
4134 else | 4134 else |
4135 eap->skip = TRUE; | 4135 eap->skip = TRUE; |
4222 } | 4222 } |
4223 | 4223 |
4224 // In Vim9 script only global functions can be redefined. | 4224 // In Vim9 script only global functions can be redefined. |
4225 if (vim9script && eap->forceit && !is_global) | 4225 if (vim9script && eap->forceit && !is_global) |
4226 { | 4226 { |
4227 emsg(_(e_nobang)); | 4227 emsg(_(e_no_bang_allowed)); |
4228 goto ret_free; | 4228 goto ret_free; |
4229 } | 4229 } |
4230 | 4230 |
4231 ga_init2(&newlines, (int)sizeof(char_u *), 10); | 4231 ga_init2(&newlines, (int)sizeof(char_u *), 10); |
4232 | 4232 |
5143 tofree = trans_function_name(&arg, NULL, eap->skip, TFN_INT, | 5143 tofree = trans_function_name(&arg, NULL, eap->skip, TFN_INT, |
5144 &fudi, &partial, in_vim9script() ? &type : NULL); | 5144 &fudi, &partial, in_vim9script() ? &type : NULL); |
5145 if (fudi.fd_newkey != NULL) | 5145 if (fudi.fd_newkey != NULL) |
5146 { | 5146 { |
5147 // Still need to give an error message for missing key. | 5147 // Still need to give an error message for missing key. |
5148 semsg(_(e_dictkey), fudi.fd_newkey); | 5148 semsg(_(e_key_not_present_in_dictionary), fudi.fd_newkey); |
5149 vim_free(fudi.fd_newkey); | 5149 vim_free(fudi.fd_newkey); |
5150 } | 5150 } |
5151 if (tofree == NULL) | 5151 if (tofree == NULL) |
5152 return; | 5152 return; |
5153 | 5153 |