comparison src/userfunc.c @ 26865:bce848ec8b1b v8.2.3961

patch 8.2.3961: error messages are spread out Commit: https://github.com/vim/vim/commit/436b5adc9770a2568209dd5ab1f98bd1afc91898 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 31 22:49:24 2021 +0000 patch 8.2.3961: 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 00:00:04 +0100
parents 2aeea8611342
children 06a137af96f8
comparison
equal deleted inserted replaced
26864:eb95ad159bce 26865:bce848ec8b1b
252 } 252 }
253 253
254 if (mustend && *p != endchar) 254 if (mustend && *p != endchar)
255 { 255 {
256 if (!skip) 256 if (!skip)
257 semsg(_(e_invarg2), *argp); 257 semsg(_(e_invalid_argument_str), *argp);
258 goto err_ret; 258 goto err_ret;
259 } 259 }
260 if (*p == endchar) 260 if (*p == endchar)
261 break; 261 break;
262 262
3690 * interrupt, or an exception. 3690 * interrupt, or an exception.
3691 */ 3691 */
3692 if (!aborting()) 3692 if (!aborting())
3693 { 3693 {
3694 if (end != NULL) 3694 if (end != NULL)
3695 semsg(_(e_invarg2), start); 3695 semsg(_(e_invalid_argument_str), start);
3696 } 3696 }
3697 else 3697 else
3698 *pp = find_name_end(start, NULL, NULL, FNE_INCL_BR); 3698 *pp = find_name_end(start, NULL, NULL, FNE_INCL_BR);
3699 goto theend; 3699 goto theend;
3700 } 3700 }
4256 for (i = 0; name_base[i] != NUL && (i == 0 4256 for (i = 0; name_base[i] != NUL && (i == 0
4257 ? eval_isnamec1(name_base[i]) 4257 ? eval_isnamec1(name_base[i])
4258 : eval_isnamec(name_base[i])); ++i) 4258 : eval_isnamec(name_base[i])); ++i)
4259 ; 4259 ;
4260 if (name_base[i] != NUL) 4260 if (name_base[i] != NUL)
4261 emsg_funcname((char *)e_invarg2, arg); 4261 emsg_funcname((char *)e_invalid_argument_str, arg);
4262 4262
4263 // In Vim9 script a function cannot have the same name as a 4263 // In Vim9 script a function cannot have the same name as a
4264 // variable. 4264 // variable.
4265 if (vim9script && *arg == K_SPECIAL 4265 if (vim9script && *arg == K_SPECIAL
4266 && eval_variable(name_base, (int)STRLEN(name_base), NULL, NULL, 4266 && eval_variable(name_base, (int)STRLEN(name_base), NULL, NULL,
4907 *p = NUL; 4907 *p = NUL;
4908 4908
4909 if (numbered_function(name) && fudi.fd_dict == NULL) 4909 if (numbered_function(name) && fudi.fd_dict == NULL)
4910 { 4910 {
4911 if (!eap->skip) 4911 if (!eap->skip)
4912 semsg(_(e_invarg2), eap->arg); 4912 semsg(_(e_invalid_argument_str), eap->arg);
4913 vim_free(name); 4913 vim_free(name);
4914 return; 4914 return;
4915 } 4915 }
4916 if (!eap->skip) 4916 if (!eap->skip)
4917 fp = find_func(name, is_global, NULL); 4917 fp = find_func(name, is_global, NULL);