patch 8.2.3830: error messages are spread out

Problem:    Error messages are spread out.
Solution:   Move more error messages to errors.h.
This commit is contained in:
Bram Moolenaar
2021-12-16 20:56:57 +00:00
parent 94c785d235
commit e124204c4f
19 changed files with 137 additions and 74 deletions

View File

@@ -2385,7 +2385,7 @@ buflist_getfile(
if ((options & GETF_ALT) && n == 0) if ((options & GETF_ALT) && n == 0)
emsg(_(e_no_alternate_file)); emsg(_(e_no_alternate_file));
else else
semsg(_("E92: Buffer %d not found"), n); semsg(_(e_buffer_nr_not_found), n);
return FAIL; return FAIL;
} }
@@ -2669,9 +2669,9 @@ buflist_findpat(
} }
if (match == -2) if (match == -2)
semsg(_("E93: More than one match for %s"), pattern); semsg(_(e_more_than_one_match_for_str), pattern);
else if (match < 0) else if (match < 0)
semsg(_("E94: No matching buffer for %s"), pattern); semsg(_(e_no_matching_buffer_for_str), pattern);
return match; return match;
} }
@@ -3373,7 +3373,7 @@ setfname(
if (obuf->b_ml.ml_mfp != NULL || in_use) if (obuf->b_ml.ml_mfp != NULL || in_use)
{ {
if (message) if (message)
emsg(_("E95: Buffer with this name already exists")); emsg(_(e_buffer_with_this_name_already_exists));
vim_free(ffname); vim_free(ffname);
return FAIL; return FAIL;
} }

View File

@@ -1349,7 +1349,7 @@ dict_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg)
dictitem_T *di; dictitem_T *di;
if (argvars[2].v_type != VAR_UNKNOWN) if (argvars[2].v_type != VAR_UNKNOWN)
semsg(_(e_toomanyarg), "remove()"); semsg(_(e_too_many_arguments_for_function_str), "remove()");
else if ((d = argvars[0].vval.v_dict) != NULL else if ((d = argvars[0].vval.v_dict) != NULL
&& !value_check_lock(d->dv_lock, arg_errmsg, TRUE)) && !value_check_lock(d->dv_lock, arg_errmsg, TRUE))
{ {

View File

@@ -173,7 +173,7 @@ diff_buf_add(buf_T *buf)
return; return;
} }
semsg(_("E96: Cannot diff more than %d buffers"), DB_COUNT); semsg(_(e_cannot_diff_more_than_nr_buffers), DB_COUNT);
} }
/* /*
@@ -1081,7 +1081,7 @@ check_external_diff(diffio_T *diffio)
{ {
if (io_error) if (io_error)
emsg(_("E810: Cannot read or write temp files")); emsg(_("E810: Cannot read or write temp files"));
emsg(_("E97: Cannot create diffs")); emsg(_(e_cannot_create_diffs));
diff_a_works = MAYBE; diff_a_works = MAYBE;
#if defined(MSWIN) #if defined(MSWIN)
diff_bin_works = MAYBE; diff_bin_works = MAYBE;
@@ -1636,7 +1636,7 @@ diff_read(
fd = mch_fopen((char *)dout->dout_fname, "r"); fd = mch_fopen((char *)dout->dout_fname, "r");
if (fd == NULL) if (fd == NULL)
{ {
emsg(_("E98: Cannot read diff output")); emsg(_(e_cannot_read_diff_output));
return; return;
} }
} }
@@ -2625,7 +2625,7 @@ ex_diffgetput(exarg_T *eap)
idx_cur = diff_buf_idx(curbuf); idx_cur = diff_buf_idx(curbuf);
if (idx_cur == DB_COUNT) if (idx_cur == DB_COUNT)
{ {
emsg(_("E99: Current buffer is not in diff mode")); emsg(_(e_current_buffer_is_not_in_diff_mode));
return; return;
} }
@@ -2646,7 +2646,7 @@ ex_diffgetput(exarg_T *eap)
if (found_not_ma) if (found_not_ma)
emsg(_("E793: No other buffer in diff mode is modifiable")); emsg(_("E793: No other buffer in diff mode is modifiable"));
else else
emsg(_("E100: No other buffer in diff mode")); emsg(_(e_no_other_buffer_in_diff_mode));
return; return;
} }
@@ -2656,7 +2656,7 @@ ex_diffgetput(exarg_T *eap)
&& curtab->tp_diffbuf[i] != NULL && curtab->tp_diffbuf[i] != NULL
&& (eap->cmdidx != CMD_diffput || curtab->tp_diffbuf[i]->b_p_ma)) && (eap->cmdidx != CMD_diffput || curtab->tp_diffbuf[i]->b_p_ma))
{ {
emsg(_("E101: More than two buffers in diff mode, don't know which one to use")); emsg(_(e_more_than_two_buffers_in_diff_mode_dont_know_which_one_to_use));
return; return;
} }
} }
@@ -2679,7 +2679,7 @@ ex_diffgetput(exarg_T *eap)
buf = buflist_findnr(i); buf = buflist_findnr(i);
if (buf == NULL) if (buf == NULL)
{ {
semsg(_("E102: Can't find buffer \"%s\""), eap->arg); semsg(_(e_cant_find_buffer_str), eap->arg);
return; return;
} }
if (buf == curbuf) if (buf == curbuf)
@@ -2687,7 +2687,7 @@ ex_diffgetput(exarg_T *eap)
idx_other = diff_buf_idx(buf); idx_other = diff_buf_idx(buf);
if (idx_other == DB_COUNT) if (idx_other == DB_COUNT)
{ {
semsg(_("E103: Buffer \"%s\" is not in diff mode"), eap->arg); semsg(_(e_buffer_str_is_not_in_diff_mode), eap->arg);
return; return;
} }
} }

View File

@@ -2043,7 +2043,7 @@ check_digraph_chars_valid(int char1, int char2)
} }
if (char1 == ESC || char2 == ESC) if (char1 == ESC || char2 == ESC)
{ {
emsg(_("E104: Escape not allowed in digraph")); emsg(_(e_escape_not_allowed_in_digraph));
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
@@ -2622,7 +2622,7 @@ ex_loadkeymap(exarg_T *eap)
if (!getline_equal(eap->getline, eap->cookie, getsourceline)) if (!getline_equal(eap->getline, eap->cookie, getsourceline))
{ {
emsg(_("E105: Using :loadkeymap not in a sourced file")); emsg(_(e_using_loadkeymap_not_in_sourced_file));
return; return;
} }

View File

@@ -196,13 +196,77 @@ EXTERN char e_no_write_since_last_change_for_buffer_nr_add_bang_to_override[]
INIT(= N_("E89: No write since last change for buffer %d (add ! to override)")); INIT(= N_("E89: No write since last change for buffer %d (add ! to override)"));
EXTERN char e_cannot_unload_last_buffer[] EXTERN char e_cannot_unload_last_buffer[]
INIT(= N_("E90: Cannot unload last buffer")); INIT(= N_("E90: Cannot unload last buffer"));
EXTERN char e_shell_option_is_empty[]
INIT(= N_("E91: 'shell' option is empty"));
EXTERN char e_buffer_nr_not_found[]
INIT(= N_("E92: Buffer %d not found"));
EXTERN char e_more_than_one_match_for_str[]
INIT(= N_("E93: More than one match for %s"));
EXTERN char e_no_matching_buffer_for_str[]
INIT(= N_("E94: No matching buffer for %s"));
EXTERN char e_buffer_with_this_name_already_exists[]
INIT(= N_("E95: Buffer with this name already exists"));
#if defined(FEAT_DIFF)
EXTERN char e_cannot_diff_more_than_nr_buffers[]
INIT(= N_("E96: Cannot diff more than %d buffers"));
EXTERN char e_cannot_create_diffs[]
INIT(= N_("E97: Cannot create diffs"));
EXTERN char e_cannot_read_diff_output[]
INIT(= N_("E98: Cannot read diff output"));
EXTERN char e_current_buffer_is_not_in_diff_mode[]
INIT(= N_("E99: Current buffer is not in diff mode"));
EXTERN char e_no_other_buffer_in_diff_mode[]
INIT(= N_("E100: No other buffer in diff mode"));
EXTERN char e_more_than_two_buffers_in_diff_mode_dont_know_which_one_to_use[]
INIT(= N_("E101: More than two buffers in diff mode, don't know which one to use"));
EXTERN char e_cant_find_buffer_str[]
INIT(= N_("E102: Can't find buffer \"%s\""));
EXTERN char e_buffer_str_is_not_in_diff_mode[]
INIT(= N_("E103: Buffer \"%s\" is not in diff mode"));
#endif
EXTERN char e_escape_not_allowed_in_digraph[]
INIT(= N_("E104: Escape not allowed in digraph"));
EXTERN char e_using_loadkeymap_not_in_sourced_file[]
INIT(= N_("E105: Using :loadkeymap not in a sourced file"));
// E106 unused
EXTERN char e_missing_parenthesis_str[]
INIT(= N_("E107: Missing parentheses: %s"));
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
EXTERN char e_no_such_variable_str[]
INIT(= N_("E108: No such variable: \"%s\""));
EXTERN char e_missing_colon_after_questionmark[]
INIT(= N_("E109: Missing ':' after '?'"));
EXTERN char e_missing_closing_paren[]
INIT(= N_("E110: Missing ')'"));
EXTERN char e_missing_closing_square_brace[]
INIT(= N_("E111: Missing ']'"));
#endif
EXTERN char e_option_name_missing_str[]
INIT(= N_("E112: Option name missing: %s"));
EXTERN char e_unknown_option_str[]
INIT(= N_("E113: Unknown option: %s"));
EXTERN char e_missing_double_quote_str[]
INIT(= N_("E114: Missing double quote: %s"));
EXTERN char e_missing_single_quote_str[]
INIT(= N_("E115: Missing single quote: %s"));
#ifdef FEAT_EVAL
EXTERN char e_invalid_arguments_for_function_str[]
INIT(= N_("E116: Invalid arguments for function %s"));
EXTERN char e_unknown_function_str[]
INIT(= N_("E117: Unknown function: %s"));
EXTERN char e_too_many_arguments_for_function_str[]
INIT(= N_("E118: Too many arguments for function: %s"));
EXTERN char e_not_enough_arguments_for_function_str[]
INIT(= N_("E119: Not enough arguments for function: %s"));
EXTERN char e_using_sid_not_in_script_context_str[]
INIT(= N_("E120: Using <SID> not in a script context: %s"));
EXTERN char e_undefined_variable_str[] EXTERN char e_undefined_variable_str[]
INIT(= N_("E121: Undefined variable: %s")); INIT(= N_("E121: Undefined variable: %s"));
EXTERN char e_undefined_variable_char_str[] EXTERN char e_undefined_variable_char_str[]
INIT(= N_("E121: Undefined variable: %c:%s")); INIT(= N_("E121: Undefined variable: %c:%s"));
#endif #endif
EXTERN char e_no_such_user_defined_command_str[] EXTERN char e_no_such_user_defined_command_str[]
INIT(= N_("E184: No such user-defined command: %s")); INIT(= N_("E184: No such user-defined command: %s"));
#ifndef FEAT_DIGRAPHS #ifndef FEAT_DIGRAPHS

View File

@@ -1071,7 +1071,7 @@ get_lval(
if (*p != ']') if (*p != ']')
{ {
if (!quiet) if (!quiet)
emsg(_(e_missbrac)); emsg(_(e_missing_closing_square_brace));
clear_tv(&var1); clear_tv(&var1);
clear_tv(&var2); clear_tv(&var2);
return NULL; return NULL;
@@ -2375,7 +2375,7 @@ eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
p = eval_next_non_blank(*arg, evalarg_used, &getnext); p = eval_next_non_blank(*arg, evalarg_used, &getnext);
if (*p != ':') if (*p != ':')
{ {
emsg(_(e_missing_colon)); emsg(_(e_missing_colon_after_questionmark));
if (evaluate && result) if (evaluate && result)
clear_tv(rettv); clear_tv(rettv);
evalarg_used->eval_flags = orig_flags; evalarg_used->eval_flags = orig_flags;
@@ -3568,7 +3568,7 @@ eval7(
++*arg; ++*arg;
else if (ret == OK) else if (ret == OK)
{ {
emsg(_(e_missing_close)); emsg(_(e_missing_closing_paren));
clear_tv(rettv); clear_tv(rettv);
ret = FAIL; ret = FAIL;
} }
@@ -3854,7 +3854,7 @@ eval_lambda(
*arg = skipwhite_and_linebreak(*arg, evalarg); *arg = skipwhite_and_linebreak(*arg, evalarg);
if (**arg != ')') if (**arg != ')')
{ {
emsg(_(e_missing_close)); emsg(_(e_missing_closing_paren));
ret = FAIL; ret = FAIL;
} }
++*arg; ++*arg;
@@ -3868,7 +3868,7 @@ eval_lambda(
if (*skipwhite(*arg) == '(') if (*skipwhite(*arg) == '(')
emsg(_(e_nowhitespace)); emsg(_(e_nowhitespace));
else else
semsg(_(e_missing_paren), "lambda"); semsg(_(e_missing_parenthesis_str), "lambda");
} }
clear_tv(rettv); clear_tv(rettv);
ret = FAIL; ret = FAIL;
@@ -3923,7 +3923,7 @@ eval_method(
if (**arg != '(') if (**arg != '(')
{ {
if (verbose) if (verbose)
semsg(_(e_missing_paren), name); semsg(_(e_missing_parenthesis_str), name);
ret = FAIL; ret = FAIL;
} }
else if (VIM_ISWHITE((*arg)[-1])) else if (VIM_ISWHITE((*arg)[-1]))
@@ -4061,7 +4061,7 @@ eval_index(
if (**arg != ']') if (**arg != ']')
{ {
if (verbose) if (verbose)
emsg(_(e_missbrac)); emsg(_(e_missing_closing_square_brace));
clear_tv(&var1); clear_tv(&var1);
if (range) if (range)
clear_tv(&var2); clear_tv(&var2);

View File

@@ -2529,9 +2529,9 @@ check_internal_func(int idx, int argcount)
name = internal_func_name(idx); name = internal_func_name(idx);
if (res == FCERR_TOOMANY) if (res == FCERR_TOOMANY)
semsg(_(e_toomanyarg), name); semsg(_(e_too_many_arguments_for_function_str), name);
else else
semsg(_(e_toofewarg), name); semsg(_(e_not_enough_arguments_for_function_str), name);
return -1; return -1;
} }
@@ -4049,7 +4049,8 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref)
arg_idx = 0; arg_idx = 0;
else if (list->lv_len > MAX_FUNC_ARGS) else if (list->lv_len > MAX_FUNC_ARGS)
{ {
emsg_funcname((char *)e_toomanyarg, s); emsg_funcname((char *)e_too_many_arguments_for_function_str,
s);
vim_free(name); vim_free(name);
goto theend; goto theend;
} }
@@ -9012,7 +9013,7 @@ f_setreg(typval_T *argvars, typval_T *rettv)
{ {
if (yank_type != MAUTO) if (yank_type != MAUTO)
{ {
semsg(_(e_toomanyarg), "setreg"); semsg(_(e_too_many_arguments_for_function_str), "setreg");
return; return;
} }

View File

@@ -1858,7 +1858,7 @@ do_unlet(char_u *name, int forceit)
} }
if (forceit) if (forceit)
return OK; return OK;
semsg(_("E108: No such variable: \"%s\""), name); semsg(_(e_no_such_variable_str), name);
return FAIL; return FAIL;
} }

View File

@@ -1689,8 +1689,6 @@ EXTERN char e_dictreq[] INIT(= N_("E715: Dictionary required"));
EXTERN char e_listidx[] INIT(= N_("E684: list index out of range: %ld")); EXTERN char e_listidx[] INIT(= N_("E684: list index out of range: %ld"));
EXTERN char e_blobidx[] INIT(= N_("E979: Blob index out of range: %ld")); EXTERN char e_blobidx[] INIT(= N_("E979: Blob index out of range: %ld"));
EXTERN char e_invalblob[] INIT(= N_("E978: Invalid operation for Blob")); EXTERN char e_invalblob[] INIT(= N_("E978: Invalid operation for Blob"));
EXTERN char e_toomanyarg[] INIT(= N_("E118: Too many arguments for function: %s"));
EXTERN char e_toofewarg[] INIT(= N_("E119: Not enough arguments for function: %s"));
EXTERN char e_func_deleted[] INIT(= N_("E933: Function was deleted: %s")); EXTERN char e_func_deleted[] INIT(= N_("E933: Function was deleted: %s"));
EXTERN char e_dictkey[] INIT(= N_("E716: Key not present in Dictionary: \"%s\"")); EXTERN char e_dictkey[] INIT(= N_("E716: Key not present in Dictionary: \"%s\""));
EXTERN char e_listreq[] INIT(= N_("E714: List required")); EXTERN char e_listreq[] INIT(= N_("E714: List required"));
@@ -1700,7 +1698,6 @@ EXTERN char e_listdictarg[] INIT(= N_("E712: Argument of %s must be a List or Di
EXTERN char e_listdictblobarg[] INIT(= N_("E896: Argument of %s must be a List, Dictionary or Blob")); EXTERN char e_listdictblobarg[] INIT(= N_("E896: Argument of %s must be a List, Dictionary or Blob"));
EXTERN char e_modulus[] INIT(= N_("E804: Cannot use '%' with Float")); EXTERN char e_modulus[] INIT(= N_("E804: Cannot use '%' with Float"));
EXTERN char e_const_option[] INIT(= N_("E996: Cannot lock an option")); EXTERN char e_const_option[] INIT(= N_("E996: Cannot lock an option"));
EXTERN char e_unknown_option[] INIT(= N_("E113: Unknown option: %s"));
EXTERN char e_reduceempty[] INIT(= N_("E998: Reduce of an empty %s with no initial value")); EXTERN char e_reduceempty[] INIT(= N_("E998: Reduce of an empty %s with no initial value"));
EXTERN char e_no_dict_key[] INIT(= N_("E857: Dictionary key \"%s\" required")); EXTERN char e_no_dict_key[] INIT(= N_("E857: Dictionary key \"%s\" required"));
#endif #endif
@@ -1711,7 +1708,6 @@ EXTERN char e_textwinlock[] INIT(= N_("E565: Not allowed to change text or chang
|| defined(UNIX) || defined(VMS) || defined(UNIX) || defined(VMS)
EXTERN char e_screenmode[] INIT(= N_("E359: Screen mode setting not supported")); EXTERN char e_screenmode[] INIT(= N_("E359: Screen mode setting not supported"));
#endif #endif
EXTERN char e_shellempty[] INIT(= N_("E91: 'shell' option is empty"));
#if defined(FEAT_SIGN_ICONS) && !defined(FEAT_GUI_GTK) #if defined(FEAT_SIGN_ICONS) && !defined(FEAT_GUI_GTK)
EXTERN char e_signdata[] INIT(= N_("E255: Couldn't read in sign data!")); EXTERN char e_signdata[] INIT(= N_("E255: Couldn't read in sign data!"));
#endif #endif
@@ -1721,8 +1717,6 @@ EXTERN char e_winheight[] INIT(= N_("E591: 'winheight' cannot be smaller than 'w
EXTERN char e_winwidth[] INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'")); EXTERN char e_winwidth[] INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'"));
EXTERN char e_zerocount[] INIT(= N_("E939: Positive count required")); EXTERN char e_zerocount[] INIT(= N_("E939: Positive count required"));
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
EXTERN char e_missing_paren[] INIT(= N_("E107: Missing parentheses: %s"));
EXTERN char e_missing_close[] INIT(= N_("E110: Missing ')'"));
EXTERN char e_missing_dict_colon[] INIT(= N_("E720: Missing colon in Dictionary: %s")); EXTERN char e_missing_dict_colon[] INIT(= N_("E720: Missing colon in Dictionary: %s"));
EXTERN char e_duplicate_key[] INIT(= N_("E721: Duplicate key in Dictionary: \"%s\"")); EXTERN char e_duplicate_key[] INIT(= N_("E721: Duplicate key in Dictionary: \"%s\""));
EXTERN char e_missing_dict_comma[] INIT(= N_("E722: Missing comma in Dictionary: %s")); EXTERN char e_missing_dict_comma[] INIT(= N_("E722: Missing comma in Dictionary: %s"));
@@ -1758,10 +1752,7 @@ EXTERN char e_menuothermode[] INIT(= N_("E328: Menu only exists in another mode"
EXTERN char e_invalwindow[] INIT(= N_("E957: Invalid window number")); EXTERN char e_invalwindow[] INIT(= N_("E957: Invalid window number"));
EXTERN char e_listarg[] INIT(= N_("E686: Argument of %s must be a List")); EXTERN char e_listarg[] INIT(= N_("E686: Argument of %s must be a List"));
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
EXTERN char e_missing_colon[] INIT(= N_("E109: Missing ':' after '?'"));
EXTERN char e_missing_in[] INIT(= N_("E690: Missing \"in\" after :for")); EXTERN char e_missing_in[] INIT(= N_("E690: Missing \"in\" after :for"));
EXTERN char e_unknownfunc[] INIT(= N_("E117: Unknown function: %s"));
EXTERN char e_missbrac[] INIT(= N_("E111: Missing ']'"));
EXTERN char e_else_without_if[] INIT(= N_("E581: :else without :if")); EXTERN char e_else_without_if[] INIT(= N_("E581: :else without :if"));
EXTERN char e_elseif_without_if[] INIT(= N_("E582: :elseif without :if")); EXTERN char e_elseif_without_if[] INIT(= N_("E582: :elseif without :if"));
EXTERN char e_endif_without_if[] INIT(= N_("E580: :endif without :if")); EXTERN char e_endif_without_if[] INIT(= N_("E580: :endif without :if"));

View File

@@ -1780,7 +1780,7 @@ call_shell(char_u *cmd, int opt)
if (*p_sh == NUL) if (*p_sh == NUL)
{ {
emsg(_(e_shellempty)); emsg(_(e_shell_option_is_empty));
retval = -1; retval = -1;
} }
else else

View File

@@ -7190,7 +7190,7 @@ qf_add_entry_from_dict(
if (!did_bufnr_emsg) if (!did_bufnr_emsg)
{ {
did_bufnr_emsg = TRUE; did_bufnr_emsg = TRUE;
semsg(_("E92: Buffer %d not found"), bufnum); semsg(_(e_buffer_nr_not_found), bufnum);
} }
valid = FALSE; valid = FALSE;
bufnum = 0; bufnum = 0;

View File

@@ -1668,7 +1668,7 @@ eval_option(
if (option_end == NULL) if (option_end == NULL)
{ {
if (rettv != NULL) if (rettv != NULL)
semsg(_("E112: Option name missing: %s"), *arg); semsg(_(e_option_name_missing_str), *arg);
return FAIL; return FAIL;
} }
@@ -1686,7 +1686,7 @@ eval_option(
if (opt_type == gov_unknown) if (opt_type == gov_unknown)
{ {
if (rettv != NULL) if (rettv != NULL)
semsg(_(e_unknown_option), *arg); semsg(_(e_unknown_option_str), *arg);
ret = FAIL; ret = FAIL;
} }
else if (rettv != NULL) else if (rettv != NULL)
@@ -1887,7 +1887,7 @@ eval_string(char_u **arg, typval_T *rettv, int evaluate)
if (*p != '"') if (*p != '"')
{ {
semsg(_("E114: Missing quote: %s"), *arg); semsg(_(e_missing_double_quote_str), *arg);
return FAIL; return FAIL;
} }
@@ -2027,7 +2027,7 @@ eval_lit_string(char_u **arg, typval_T *rettv, int evaluate)
if (*p != '\'') if (*p != '\'')
{ {
semsg(_("E115: Missing quote: %s"), *arg); semsg(_(e_missing_single_quote_str), *arg);
return FAIL; return FAIL;
} }

View File

@@ -577,7 +577,7 @@ ui_suspend(void)
suspend_shell(void) suspend_shell(void)
{ {
if (*p_sh == NUL) if (*p_sh == NUL)
emsg(_(e_shellempty)); emsg(_(e_shell_option_is_empty));
else else
{ {
msg_puts(_("new shell started\n")); msg_puts(_("new shell started\n"));

View File

@@ -1780,7 +1780,7 @@ get_func_tv(
if (argcount == MAX_FUNC_ARGS) if (argcount == MAX_FUNC_ARGS)
emsg_funcname(N_("E740: Too many arguments for function %s"), name); emsg_funcname(N_("E740: Too many arguments for function %s"), name);
else else
emsg_funcname(N_("E116: Invalid arguments for function %s"), name); emsg_funcname(N_(e_invalid_arguments_for_function_str), name);
} }
while (--argcount >= 0) while (--argcount >= 0)
@@ -3240,7 +3240,7 @@ user_func_error(int error, char_u *name, funcexe_T *funcexe)
if (funcexe->fe_found_var) if (funcexe->fe_found_var)
semsg(_(e_not_callable_type_str), name); semsg(_(e_not_callable_type_str), name);
else else
emsg_funcname(e_unknownfunc, name); emsg_funcname(e_unknown_function_str, name);
break; break;
case FCERR_NOTMETHOD: case FCERR_NOTMETHOD:
emsg_funcname( emsg_funcname(
@@ -3250,14 +3250,16 @@ user_func_error(int error, char_u *name, funcexe_T *funcexe)
emsg_funcname(N_(e_func_deleted), name); emsg_funcname(N_(e_func_deleted), name);
break; break;
case FCERR_TOOMANY: case FCERR_TOOMANY:
emsg_funcname((char *)e_toomanyarg, name); emsg_funcname((char *)e_too_many_arguments_for_function_str,
name);
break; break;
case FCERR_TOOFEW: case FCERR_TOOFEW:
emsg_funcname((char *)e_toofewarg, name); emsg_funcname((char *)e_not_enough_arguments_for_function_str,
name);
break; break;
case FCERR_SCRIPT: case FCERR_SCRIPT:
emsg_funcname( emsg_funcname(
N_("E120: Using <SID> not in a script context: %s"), name); N_(e_using_sid_not_in_script_context_str), name);
break; break;
case FCERR_DICT: case FCERR_DICT:
emsg_funcname( emsg_funcname(
@@ -5098,7 +5100,7 @@ ex_call(exarg_T *eap)
startarg = skipwhite(arg); startarg = skipwhite(arg);
if (*startarg != '(') if (*startarg != '(')
{ {
semsg(_(e_missing_paren), eap->arg); semsg(_(e_missing_parenthesis_str), eap->arg);
goto end; goto end;
} }
if (in_vim9script() && startarg > arg) if (in_vim9script() && startarg > arg)

View File

@@ -749,6 +749,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
3830,
/**/ /**/
3829, 3829,
/**/ /**/

View File

@@ -2008,12 +2008,14 @@ generate_CALL(cctx_T *cctx, ufunc_T *ufunc, int pushed_argcount)
RETURN_OK_IF_SKIP(cctx); RETURN_OK_IF_SKIP(cctx);
if (argcount > regular_args && !has_varargs(ufunc)) if (argcount > regular_args && !has_varargs(ufunc))
{ {
semsg(_(e_toomanyarg), printable_func_name(ufunc)); semsg(_(e_too_many_arguments_for_function_str),
printable_func_name(ufunc));
return FAIL; return FAIL;
} }
if (argcount < regular_args - ufunc->uf_def_args.ga_len) if (argcount < regular_args - ufunc->uf_def_args.ga_len)
{ {
semsg(_(e_toofewarg), printable_func_name(ufunc)); semsg(_(e_not_enough_arguments_for_function_str),
printable_func_name(ufunc));
return FAIL; return FAIL;
} }
@@ -2145,12 +2147,12 @@ generate_PCALL(
if (argcount < type->tt_min_argcount - varargs) if (argcount < type->tt_min_argcount - varargs)
{ {
semsg(_(e_toofewarg), name); semsg(_(e_not_enough_arguments_for_function_str), name);
return FAIL; return FAIL;
} }
if (!varargs && argcount > type->tt_argcount) if (!varargs && argcount > type->tt_argcount)
{ {
semsg(_(e_toomanyarg), name); semsg(_(e_too_many_arguments_for_function_str), name);
return FAIL; return FAIL;
} }
if (type->tt_args != NULL) if (type->tt_args != NULL)
@@ -3444,7 +3446,7 @@ compile_arguments(char_u **arg, cctx_T *cctx, int *argcount, int is_searchpair)
p = skipwhite(p); p = skipwhite(p);
} }
failret: failret:
emsg(_(e_missing_close)); emsg(_(e_missing_closing_paren));
return FAIL; return FAIL;
} }
@@ -3580,7 +3582,7 @@ compile_call(
res = generate_BCALL(cctx, idx, argcount, argcount_init == 1); res = generate_BCALL(cctx, idx, argcount, argcount_init == 1);
} }
else else
semsg(_(e_unknownfunc), namebuf); semsg(_(e_unknown_function_str), namebuf);
goto theend; goto theend;
} }
@@ -3625,7 +3627,7 @@ compile_call(
if (STRNCMP(namebuf, "g:", 2) == 0 || is_autoload) if (STRNCMP(namebuf, "g:", 2) == 0 || is_autoload)
res = generate_UCALL(cctx, name, argcount); res = generate_UCALL(cctx, name, argcount);
else else
semsg(_(e_unknownfunc), namebuf); semsg(_(e_unknown_function_str), namebuf);
theend: theend:
vim_free(tofree); vim_free(tofree);
@@ -4354,7 +4356,7 @@ compile_parenthesis(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
++*arg; ++*arg;
else if (ret == OK) else if (ret == OK)
{ {
emsg(_(e_missing_close)); emsg(_(e_missing_closing_paren));
ret = FAIL; ret = FAIL;
} }
return ret; return ret;
@@ -4471,7 +4473,7 @@ compile_subscript(
if (*skipwhite(*arg) == '(') if (*skipwhite(*arg) == '(')
emsg(_(e_nowhitespace)); emsg(_(e_nowhitespace));
else else
semsg(_(e_missing_paren), *arg); semsg(_(e_missing_parenthesis_str), *arg);
return FAIL; return FAIL;
} }
*arg = skipwhite(*arg + 1); *arg = skipwhite(*arg + 1);
@@ -4530,7 +4532,7 @@ compile_subscript(
; ;
if (*p != '(') if (*p != '(')
{ {
semsg(_(e_missing_paren), *arg); semsg(_(e_missing_parenthesis_str), *arg);
return FAIL; return FAIL;
} }
if (compile_call(arg, p - *arg, cctx, ppconst, 1) == FAIL) if (compile_call(arg, p - *arg, cctx, ppconst, 1) == FAIL)
@@ -4604,7 +4606,7 @@ compile_subscript(
if (**arg != ']') if (**arg != ']')
{ {
emsg(_(e_missbrac)); emsg(_(e_missing_closing_square_brace));
return FAIL; return FAIL;
} }
*arg = *arg + 1; *arg = *arg + 1;
@@ -5636,7 +5638,7 @@ compile_expr1(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
p = may_peek_next_line(cctx, *arg, &next); p = may_peek_next_line(cctx, *arg, &next);
if (*p != ':') if (*p != ':')
{ {
emsg(_(e_missing_colon)); emsg(_(e_missing_colon_after_questionmark));
return FAIL; return FAIL;
} }
if (next != NULL) if (next != NULL)
@@ -6141,7 +6143,7 @@ get_var_dest(
switch (opt_type) switch (opt_type)
{ {
case gov_unknown: case gov_unknown:
semsg(_(e_unknown_option), name); semsg(_(e_unknown_option_str), name);
return FAIL; return FAIL;
case gov_string: case gov_string:
case gov_hidden_string: case gov_hidden_string:
@@ -6718,7 +6720,7 @@ compile_assign_index(
if (r == OK && *skipwhite(p) != ']') if (r == OK && *skipwhite(p) != ']')
{ {
// this should not happen // this should not happen
emsg(_(e_missbrac)); emsg(_(e_missing_closing_square_brace));
r = FAIL; r = FAIL;
} }
} }
@@ -6762,7 +6764,7 @@ compile_load_lhs(
{ {
// this should not happen // this should not happen
if (res != FAIL) if (res != FAIL)
emsg(_(e_missbrac)); emsg(_(e_missing_closing_square_brace));
return FAIL; return FAIL;
} }

View File

@@ -906,9 +906,10 @@ call_ufunc(
if (error != FCERR_UNKNOWN) if (error != FCERR_UNKNOWN)
{ {
if (error == FCERR_TOOMANY) if (error == FCERR_TOOMANY)
semsg(_(e_toomanyarg), ufunc->uf_name); semsg(_(e_too_many_arguments_for_function_str), ufunc->uf_name);
else else
semsg(_(e_toofewarg), ufunc->uf_name); semsg(_(e_not_enough_arguments_for_function_str),
ufunc->uf_name);
return FAIL; return FAIL;
} }
@@ -1106,7 +1107,7 @@ call_partial(
if (res == FAIL) if (res == FAIL)
{ {
if (called_emsg == called_emsg_before) if (called_emsg == called_emsg_before)
semsg(_(e_unknownfunc), semsg(_(e_unknown_function_str),
name == NULL ? (char_u *)"[unknown]" : name); name == NULL ? (char_u *)"[unknown]" : name);
return FAIL; return FAIL;
} }
@@ -1460,12 +1461,12 @@ call_eval_func(
v = find_var(name, NULL, FALSE); v = find_var(name, NULL, FALSE);
if (v == NULL) if (v == NULL)
{ {
semsg(_(e_unknownfunc), name); semsg(_(e_unknown_function_str), name);
return FAIL; return FAIL;
} }
if (v->di_tv.v_type != VAR_PARTIAL && v->di_tv.v_type != VAR_FUNC) if (v->di_tv.v_type != VAR_PARTIAL && v->di_tv.v_type != VAR_FUNC)
{ {
semsg(_(e_unknownfunc), name); semsg(_(e_unknown_function_str), name);
return FAIL; return FAIL;
} }
return call_partial(&v->di_tv, argcount, ectx); return call_partial(&v->di_tv, argcount, ectx);

View File

@@ -618,12 +618,12 @@ check_argument_types(
return OK; // just in case return OK; // just in case
if (argcount < type->tt_min_argcount - varargs) if (argcount < type->tt_min_argcount - varargs)
{ {
semsg(_(e_toofewarg), name); semsg(_(e_not_enough_arguments_for_function_str), name);
return FAIL; return FAIL;
} }
if (!varargs && type->tt_argcount >= 0 && argcount > type->tt_argcount) if (!varargs && type->tt_argcount >= 0 && argcount > type->tt_argcount)
{ {
semsg(_(e_toomanyarg), name); semsg(_(e_too_many_arguments_for_function_str), name);
return FAIL; return FAIL;
} }
if (type->tt_args == NULL) if (type->tt_args == NULL)
@@ -893,7 +893,7 @@ parse_type(char_u **arg, garray_T *type_gap, int give_error)
if (*p != ')') if (*p != ')')
{ {
if (give_error) if (give_error)
emsg(_(e_missing_close)); emsg(_(e_missing_closing_paren));
return NULL; return NULL;
} }
*arg = p + 1; *arg = p + 1;

View File

@@ -198,7 +198,7 @@ do_window(
if (Prenum == 0) if (Prenum == 0)
emsg(_(e_no_alternate_file)); emsg(_(e_no_alternate_file));
else else
semsg(_("E92: Buffer %ld not found"), Prenum); semsg(_(e_buffer_nr_not_found), Prenum);
break; break;
} }