comparison src/userfunc.c @ 21821:0deb6f96a5a3 v8.2.1460

patch 8.2.1460: error messages are spread out Commit: https://github.com/vim/vim/commit/451c2e3536a3cb77d07faf3cb2b834512e174351 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 15 16:33:28 2020 +0200 patch 8.2.1460: error messages are spread out Problem: Error messages are spread out. Solution: Move more messages into errors.h.
author Bram Moolenaar <Bram@vim.org>
date Sat, 15 Aug 2020 16:45:04 +0200
parents d504fcd3d2c0
children a427f5f26419
comparison
equal deleted inserted replaced
21820:5ab859e4430b 21821:0deb6f96a5a3
108 { 108 {
109 char_u *type = NULL; 109 char_u *type = NULL;
110 110
111 if (VIM_ISWHITE(*p) && *skipwhite(p) == ':') 111 if (VIM_ISWHITE(*p) && *skipwhite(p) == ':')
112 { 112 {
113 semsg(_("E1059: No white space allowed before colon: %s"), 113 semsg(_(e_no_white_space_allowed_before_colon_str),
114 arg_copy == NULL ? arg : arg_copy); 114 arg_copy == NULL ? arg : arg_copy);
115 p = skipwhite(p); 115 p = skipwhite(p);
116 } 116 }
117 if (*p == ':') 117 if (*p == ':')
118 { 118 {
126 p = skip_type(type, TRUE); 126 p = skip_type(type, TRUE);
127 type = vim_strnsave(type, p - type); 127 type = vim_strnsave(type, p - type);
128 } 128 }
129 else if (*skipwhite(p) != '=') 129 else if (*skipwhite(p) != '=')
130 { 130 {
131 semsg(_("E1077: Missing argument type for %s"), 131 semsg(_(e_missing_argument_type_for_str),
132 arg_copy == NULL ? arg : arg_copy); 132 arg_copy == NULL ? arg : arg_copy);
133 return arg; 133 return arg;
134 } 134 }
135 ((char_u **)argtypes->ga_data)[argtypes->ga_len++] = type; 135 ((char_u **)argtypes->ga_data)[argtypes->ga_len++] = type;
136 } 136 }
210 if (argtypes != NULL) 210 if (argtypes != NULL)
211 { 211 {
212 // ...name: list<type> 212 // ...name: list<type>
213 if (!ASCII_ISALPHA(*p)) 213 if (!ASCII_ISALPHA(*p))
214 { 214 {
215 emsg(_("E1055: Missing name after ...")); 215 emsg(_(e_missing_name_after_dots));
216 break; 216 break;
217 } 217 }
218 218
219 arg = p; 219 arg = p;
220 p = one_function_arg(p, newargs, argtypes, skip); 220 p = one_function_arg(p, newargs, argtypes, skip);
1174 { 1174 {
1175 ufunc_T *ufunc = find_func_even_dead(lambda, TRUE, NULL); 1175 ufunc_T *ufunc = find_func_even_dead(lambda, TRUE, NULL);
1176 ufunc_T *fp; 1176 ufunc_T *fp;
1177 1177
1178 if (ufunc == NULL) 1178 if (ufunc == NULL)
1179 semsg(_("E1102: lambda function not found: %s"), lambda); 1179 semsg(_(e_lambda_function_not_found_str), lambda);
1180 else 1180 else
1181 { 1181 {
1182 // TODO: handle ! to overwrite 1182 // TODO: handle ! to overwrite
1183 fp = find_func(global, TRUE, NULL); 1183 fp = find_func(global, TRUE, NULL);
1184 if (fp != NULL) 1184 if (fp != NULL)
2885 ret_type = vim_strnsave(ret_type, p - ret_type); 2885 ret_type = vim_strnsave(ret_type, p - ret_type);
2886 p = skipwhite(p); 2886 p = skipwhite(p);
2887 } 2887 }
2888 else 2888 else
2889 { 2889 {
2890 semsg(_("E1056: expected a type: %s"), ret_type); 2890 semsg(_(e_expected_type_str), ret_type);
2891 ret_type = NULL; 2891 ret_type = NULL;
2892 } 2892 }
2893 } 2893 }
2894 p = skipwhite(p); 2894 p = skipwhite(p);
2895 } 2895 }
3016 if (KeyTyped) 3016 if (KeyTyped)
3017 lines_left = Rows - 1; 3017 lines_left = Rows - 1;
3018 if (theline == NULL) 3018 if (theline == NULL)
3019 { 3019 {
3020 if (eap->cmdidx == CMD_def) 3020 if (eap->cmdidx == CMD_def)
3021 emsg(_("E1057: Missing :enddef")); 3021 emsg(_(e_missing_enddef));
3022 else 3022 else
3023 emsg(_("E126: Missing :endfunction")); 3023 emsg(_("E126: Missing :endfunction"));
3024 goto erret; 3024 goto erret;
3025 } 3025 }
3026 3026
3117 p += eval_fname_script(p); 3117 p += eval_fname_script(p);
3118 vim_free(trans_function_name(&p, NULL, TRUE, 0, NULL, NULL)); 3118 vim_free(trans_function_name(&p, NULL, TRUE, 0, NULL, NULL));
3119 if (*skipwhite(p) == '(') 3119 if (*skipwhite(p) == '(')
3120 { 3120 {
3121 if (nesting == MAX_FUNC_NESTING - 1) 3121 if (nesting == MAX_FUNC_NESTING - 1)
3122 emsg(_("E1058: function nesting too deep")); 3122 emsg(_(e_function_nesting_too_deep));
3123 else 3123 else
3124 { 3124 {
3125 ++nesting; 3125 ++nesting;
3126 nesting_def[nesting] = (c == 'd'); 3126 nesting_def[nesting] = (c == 'd');
3127 indent += 2; 3127 indent += 2;
3783 semsg(_("E131: Cannot delete function %s: It is in use"), eap->arg); 3783 semsg(_("E131: Cannot delete function %s: It is in use"), eap->arg);
3784 return; 3784 return;
3785 } 3785 }
3786 if (fp->uf_flags & FC_VIM9) 3786 if (fp->uf_flags & FC_VIM9)
3787 { 3787 {
3788 semsg(_("E1084: Cannot delete Vim9 script function %s"), eap->arg); 3788 semsg(_(e_cannot_delete_vim9_script_function_str), eap->arg);
3789 return; 3789 return;
3790 } 3790 }
3791 3791
3792 if (fudi.fd_dict != NULL) 3792 if (fudi.fd_dict != NULL)
3793 { 3793 {