diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-12-31 22:49:24 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-12-31 22:49:24 +0000 |
commit | 436b5adc9770a2568209dd5ab1f98bd1afc91898 (patch) | |
tree | 623dc85ee9a396b16f939f44d38138f882edc229 | |
parent | f1474d801bbdb73406dd3d1f931f515f99e86dfa (diff) | |
download | vim-git-436b5adc9770a2568209dd5ab1f98bd1afc91898.tar.gz |
patch 8.2.3961: error messages are spread outv8.2.3961
Problem: Error messages are spread out.
Solution: Move more errors to errors.h.
62 files changed, 427 insertions, 403 deletions
diff --git a/src/arglist.c b/src/arglist.c index d159f3f7c..104c67a00 100644 --- a/src/arglist.c +++ b/src/arglist.c @@ -850,7 +850,7 @@ ex_argdelete(exarg_T *eap) n = eap->line2 - eap->line1 + 1; if (*eap->arg != NUL) // Can't have both a range and an argument. - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else if (n <= 0) { // Don't give an error for ":%argdel" if the list is empty. diff --git a/src/autocmd.c b/src/autocmd.c index 94bd49aa6..4831ea80d 100644 --- a/src/autocmd.c +++ b/src/autocmd.c @@ -580,7 +580,7 @@ do_augroup(char_u *arg, int del_group) if (del_group) { if (*arg == NUL) - emsg(_(e_argreq)); + emsg(_(e_argument_required)); else au_del_group(arg); } diff --git a/src/blob.c b/src/blob.c index 9d41bdc27..37d2be69b 100644 --- a/src/blob.c +++ b/src/blob.c @@ -614,7 +614,7 @@ blob_insert_func(typval_T *argvars, typval_T *rettv) return; // type error; errmsg already given if (before < 0 || before > len) { - semsg(_(e_invarg2), tv_get_string(&argvars[2])); + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[2])); return; } } @@ -623,7 +623,7 @@ blob_insert_func(typval_T *argvars, typval_T *rettv) return; if (val < 0 || val > 255) { - semsg(_(e_invarg2), tv_get_string(&argvars[1])); + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[1])); return; } diff --git a/src/bufwrite.c b/src/bufwrite.c index 45e962848..c0d5de36c 100644 --- a/src/bufwrite.c +++ b/src/bufwrite.c @@ -1482,7 +1482,7 @@ buf_write( ui_breakcheck(); if (got_int) { - errmsg = (char_u *)_(e_interr); + errmsg = (char_u *)_(e_interrupted); break; } } @@ -1649,7 +1649,7 @@ buf_write( ml_preserve(buf, FALSE); if (got_int) { - errmsg = (char_u *)_(e_interr); + errmsg = (char_u *)_(e_interrupted); goto restore_backup; } } @@ -2295,7 +2295,7 @@ restore_backup: } } else if (got_int) - errmsg = (char_u *)_(e_interr); + errmsg = (char_u *)_(e_interrupted); else errmsg = (char_u *)_(e_write_error_file_system_full); } @@ -2315,7 +2315,7 @@ restore_backup: // know we got the message. if (got_int) { - msg(_(e_interr)); + msg(_(e_interrupted)); out_flush(); } if ((fd = mch_open((char *)backup, O_RDONLY | O_EXTRA, 0)) >= 0) diff --git a/src/channel.c b/src/channel.c index 05e248933..513344017 100644 --- a/src/channel.c +++ b/src/channel.c @@ -1318,7 +1318,7 @@ channel_open_func(typval_T *argvars) if (argvars[1].v_type != VAR_UNKNOWN && (argvars[1].v_type != VAR_DICT || argvars[1].vval.v_dict == NULL)) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return NULL; } @@ -1330,7 +1330,7 @@ channel_open_func(typval_T *argvars) p = vim_strchr(address + 1, ']'); if (p == NULL || *++p != ':') { - semsg(_(e_invarg2), address); + semsg(_(e_invalid_argument_str), address); return NULL; } } @@ -1339,14 +1339,14 @@ channel_open_func(typval_T *argvars) p = vim_strchr(address, ':'); if (p == NULL) { - semsg(_(e_invarg2), address); + semsg(_(e_invalid_argument_str), address); return NULL; } } port = strtol((char *)(p + 1), &rest, 10); if (*address == NUL || port <= 0 || port >= 65536 || *rest != NUL) { - semsg(_(e_invarg2), address); + semsg(_(e_invalid_argument_str), address); return NULL; } if (is_ipv6) @@ -1367,7 +1367,7 @@ channel_open_func(typval_T *argvars) goto theend; if (opt.jo_timeout < 0) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); goto theend; } @@ -3833,7 +3833,7 @@ get_channel_arg(typval_T *tv, int check_open, int reading, ch_part_T part) } else { - semsg(_(e_invarg2), tv_get_string(tv)); + semsg(_(e_invalid_argument_str), tv_get_string(tv)); return NULL; } if (channel != NULL && reading) diff --git a/src/clipboard.c b/src/clipboard.c index 38596f589..09d05c9ee 100644 --- a/src/clipboard.c +++ b/src/clipboard.c @@ -1305,12 +1305,12 @@ check_clipboard_option(void) p += 8; new_exclude_prog = vim_regcomp(p, RE_MAGIC); if (new_exclude_prog == NULL) - errmsg = e_invarg; + errmsg = e_invalid_argument; break; } else { - errmsg = e_invarg; + errmsg = e_invalid_argument; break; } if (*p == ',') diff --git a/src/cmdexpand.c b/src/cmdexpand.c index 73c5a9166..9468beba7 100644 --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -2903,7 +2903,7 @@ f_getcompletion(typval_T *argvars, typval_T *rettv) pat = tv_get_string(&argvars[0]); if (argvars[1].v_type != VAR_STRING) { - semsg(_(e_invarg2), "type must be a string"); + semsg(_(e_invalid_argument_str), "type must be a string"); return; } type = tv_get_string(&argvars[1]); @@ -2933,7 +2933,7 @@ f_getcompletion(typval_T *argvars, typval_T *rettv) xpc.xp_context = cmdcomplete_str_to_type(type); if (xpc.xp_context == EXPAND_NOTHING) { - semsg(_(e_invarg2), type); + semsg(_(e_invalid_argument_str), type); return; } diff --git a/src/debugger.c b/src/debugger.c index 57a94a180..54bf6ba87 100644 --- a/src/debugger.c +++ b/src/debugger.c @@ -594,7 +594,7 @@ dbg_parsearg( bp->dbg_type = DBG_EXPR; else { - semsg(_(e_invarg2), p); + semsg(_(e_invalid_argument_str), p); return FAIL; } p = skipwhite(p + 4); @@ -619,7 +619,7 @@ dbg_parsearg( || (here && *p != NUL) || (bp->dbg_type == DBG_FUNC && strstr((char *)p, "()") != NULL)) { - semsg(_(e_invarg2), arg); + semsg(_(e_invalid_argument_str), arg); return FAIL; } diff --git a/src/dict.c b/src/dict.c index b49005ab4..6773c757d 100644 --- a/src/dict.c +++ b/src/dict.c @@ -720,7 +720,7 @@ dict_get_number_check(dict_T *d, char_u *key) return 0; if (di->di_tv.v_type != VAR_NUMBER) { - semsg(_(e_invarg2), tv_get_string(&di->di_tv)); + semsg(_(e_invalid_argument_str), tv_get_string(&di->di_tv)); return 0; } return tv_get_number(&di->di_tv); @@ -1257,7 +1257,7 @@ dict_extend_func( break; if (i == 3) { - semsg(_(e_invarg2), action); + semsg(_(e_invalid_argument_str), action); return; } } diff --git a/src/errors.h b/src/errors.h index ccd8dbde4..e5f004e9f 100644 --- a/src/errors.h +++ b/src/errors.h @@ -10,6 +10,9 @@ * Definition of error messages, sorted on error number. */ +EXTERN char e_interrupted[] + INIT(= N_("Interrupted")); + EXTERN char e_backslash_should_be_followed_by[] INIT(= N_("E10: \\ should be followed by /, ? or &")); #ifdef FEAT_CMDWIN @@ -494,7 +497,19 @@ EXTERN char e_makemap_illegal_mode[] EXTERN char e_cannot_start_the_GUI[] INIT(= N_("E229: Cannot start the GUI")); - +#if defined(FEAT_GUI) && defined(FEAT_XFONTSET) +EXTERN char e_unknown_fontset_str[] + INIT(= N_("E234: Unknown fontset: %s")); +#endif +#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) \ + || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_HAIKU) +EXTERN char e_unknown_font_str[] + INIT(= N_("E235: Unknown font: %s")); +#endif +#if defined(FEAT_GUI_X11) && !defined(FEAT_GUI_GTK) +EXTERN char e_font_str_is_not_fixed_width[] + INIT(= N_("E236: Font \"%s\" is not fixed-width")); +#endif EXTERN char e_window_layout_changed_unexpectedly[] INIT(= N_("E249: window layout changed unexpectedly")); #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) @@ -513,6 +528,22 @@ EXTERN char e_cannot_write_buftype_option_is_set[] EXTERN char e_ambiguous_use_of_user_defined_command[] INIT(= N_("E464: Ambiguous use of user-defined command")); +EXTERN char e_command_aborted[] + INIT(= N_("E470: Command aborted")); +EXTERN char e_argument_required[] + INIT(= N_("E471: Argument required")); +EXTERN char e_command_failed[] + INIT(= N_("E472: Command failed")); +EXTERN char e_internal_error_in_regexp[] + INIT(= N_("E473: Internal error in regexp")); +EXTERN char e_invalid_argument[] + INIT(= N_("E474: Invalid argument")); +EXTERN char e_invalid_argument_str[] + INIT(= N_("E475: Invalid argument: %s")); +EXTERN char e_invalid_value_for_argument_str[] + INIT(= N_("E475: Invalid value for argument %s")); +EXTERN char e_invalid_value_for_argument_str_str[] + INIT(= N_("E475: Invalid value for argument %s: %s")); EXTERN char e_invalid_command[] INIT(= N_("E476: Invalid command")); #ifdef FEAT_EVAL @@ -556,6 +587,22 @@ EXTERN char e_no_buffers_were_deleted[] INIT(= N_("E516: No buffers were deleted")); EXTERN char e_no_buffers_were_wiped_out[] INIT(= N_("E517: No buffers were wiped out")); +#ifdef FEAT_EVAL +EXTERN char e_endwhile_without_while[] + INIT(= N_("E588: :endwhile without :while")); +EXTERN char e_endfor_without_for[] + INIT(= N_("E588: :endfor without :for")); +EXTERN char e_missing_endtry[] + INIT(= N_("E600: Missing :endtry")); +EXTERN char e_endtry_without_try[] + INIT(= N_("E602: :endtry without :try")); +EXTERN char e_catch_without_try[] + INIT(= N_("E603: :catch without :try")); +EXTERN char e_finally_without_try[] + INIT(= N_("E606: :finally without :try")); +EXTERN char e_multiple_finally[] + INIT(= N_("E607: multiple :finally")); +#endif EXTERN char e_no_argument_to_delete[] INIT(= N_("E610: No argument to delete")); diff --git a/src/eval.c b/src/eval.c index 40a591046..0c5967b6c 100644 --- a/src/eval.c +++ b/src/eval.c @@ -869,7 +869,7 @@ get_lval( if (!aborting() && !quiet) { emsg_severe = TRUE; - semsg(_(e_invarg2), name); + semsg(_(e_invalid_argument_str), name); return NULL; } } diff --git a/src/evalfunc.c b/src/evalfunc.c index b9310c193..9b49d81e8 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -3188,7 +3188,7 @@ set_cursorpos(typval_T *argvars, typval_T *rettv, int charcol) if (list2fpos(argvars, &pos, NULL, &curswant, charcol) == FAIL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } line = pos.lnum; @@ -3207,7 +3207,7 @@ set_cursorpos(typval_T *argvars, typval_T *rettv, int charcol) { line = tv_get_lnum(argvars); if (line < 0) - semsg(_(e_invarg2), tv_get_string(&argvars[0])); + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[0])); col = (long)tv_get_number_chk(&argvars[1], NULL); if (charcol) col = buf_charidx_to_byteidx(curbuf, line, col) + 1; @@ -3216,7 +3216,7 @@ set_cursorpos(typval_T *argvars, typval_T *rettv, int charcol) } else { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } if (line < 0 || col < 0 || coladd < 0) @@ -3265,7 +3265,7 @@ f_debugbreak(typval_T *argvars, typval_T *rettv) pid = (int)tv_get_number(&argvars[0]); if (pid == 0) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else { HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, pid); @@ -4094,7 +4094,7 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref) } if (s == NULL) { - semsg(_(e_invarg2), "NULL"); + semsg(_(e_invalid_argument_str), "NULL"); return; } @@ -4109,7 +4109,7 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref) if (s == NULL || *s == NUL || (use_string && VIM_ISDIGIT(*s)) || (is_funcref && trans_name == NULL)) - semsg(_(e_invarg2), use_string ? tv_get_string(&argvars[0]) : s); + semsg(_(e_invalid_argument_str), use_string ? tv_get_string(&argvars[0]) : s); // Don't check an autoload name for existence here. else if (trans_name != NULL && (is_funcref ? find_func(trans_name, is_global, NULL) == NULL @@ -4402,7 +4402,7 @@ f_get(typval_T *argvars, typval_T *rettv) } } else - semsg(_(e_invarg2), what); + semsg(_(e_invalid_argument_str), what); // When {what} == "dict" and pt->pt_dict == NULL, evaluate the // third argument @@ -4887,7 +4887,7 @@ f_gettext(typval_T *argvars, typval_T *rettv) || argvars[0].vval.v_string == NULL || *argvars[0].vval.v_string == NUL) { - semsg(_(e_invarg2), tv_get_string(&argvars[0])); + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[0])); } else { @@ -6697,7 +6697,7 @@ f_islocked(typval_T *argvars, typval_T *rettv) if (*end != NUL) { semsg(_(lv.ll_name == lv.ll_name_end - ? e_invarg2 : e_trailing_arg), end); + ? e_invalid_argument_str : e_trailing_arg), end); } else { @@ -7760,7 +7760,7 @@ f_rand(typval_T *argvars, typval_T *rettv) return; theend: - semsg(_(e_invarg2), tv_get_string(&argvars[0])); + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[0])); rettv->v_type = VAR_NUMBER; rettv->vval.v_number = -1; } @@ -8085,7 +8085,7 @@ get_search_arg(typval_T *varp, int *flagsp) } if (mask == 0) { - semsg(_(e_invarg2), flags); + semsg(_(e_invalid_argument_str), flags); dir = 0; } else @@ -8175,7 +8175,7 @@ search_cmn(typval_T *argvars, pos_T *match_pos, int *flagsp) if (((flags & (SP_REPEAT | SP_RETCOUNT)) != 0) || ((flags & SP_NOMOVE) && (flags & SP_SETPCMARK))) { - semsg(_(e_invarg2), tv_get_string(&argvars[1])); + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[1])); goto theend; } @@ -8519,7 +8519,7 @@ searchpair_cmn(typval_T *argvars, pos_T *match_pos) if ((flags & (SP_END | SP_SUBPAT)) != 0 || ((flags & SP_NOMOVE) && (flags & SP_SETPCMARK))) { - semsg(_(e_invarg2), tv_get_string(&argvars[3])); + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[3])); goto theend; } @@ -8541,7 +8541,7 @@ searchpair_cmn(typval_T *argvars, pos_T *match_pos) lnum_stop = (long)tv_get_number_chk(&argvars[5], NULL); if (lnum_stop < 0) { - semsg(_(e_invarg2), tv_get_string(&argvars[5])); + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[5])); goto theend; } #ifdef FEAT_RELTIME @@ -8550,7 +8550,7 @@ searchpair_cmn(typval_T *argvars, pos_T *match_pos) time_limit = (long)tv_get_number_chk(&argvars[6], NULL); if (time_limit < 0) { - semsg(_(e_invarg2), tv_get_string(&argvars[6])); + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[6])); goto theend; } } @@ -8851,7 +8851,7 @@ set_position(typval_T *argvars, typval_T *rettv, int charpos) rettv->vval.v_number = 0; } else - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); } } } @@ -8966,7 +8966,7 @@ f_setfperm(typval_T *argvars, typval_T *rettv) return; if (STRLEN(mode_str) != 9) { - semsg(_(e_invarg2), mode_str); + semsg(_(e_invalid_argument_str), mode_str); return; } @@ -9085,7 +9085,7 @@ f_setreg(typval_T *argvars, typval_T *rettv) if (ret == FAIL || *++stropt != NUL) { - semsg(_(e_invargval), "value"); + semsg(_(e_invalid_value_for_argument_str), "value"); return; } } diff --git a/src/evalvars.c b/src/evalvars.c index 03ed5c103..381bda495 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -792,7 +792,7 @@ ex_let(exarg_T *eap) { // ":let" without "=": list variables if (*arg == '[') - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else if (expr[0] == '.' && expr[1] == '=') emsg(_("E985: .= is not supported with script version >= 2")); else if (!ends_excmd2(eap->cmd, arg)) @@ -1049,7 +1049,7 @@ skip_var_list( if (s == p) { if (!silent) - semsg(_(e_invarg2), p); + semsg(_(e_invalid_argument_str), p); return NULL; } ++*var_count; @@ -1069,7 +1069,7 @@ skip_var_list( else if (*p != ',') { if (!silent) - semsg(_(e_invarg2), p); + semsg(_(e_invalid_argument_str), p); return NULL; } } @@ -1220,7 +1220,7 @@ list_arg_vars(exarg_T *eap, char_u *arg, int *first) if (len < 0 && !aborting()) { emsg_severe = TRUE; - semsg(_(e_invarg2), arg); + semsg(_(e_invalid_argument_str), arg); break; } error = TRUE; @@ -1316,7 +1316,7 @@ ex_let_env( name = arg; len = get_env_len(&arg); if (len == 0) - semsg(_(e_invarg2), name - 1); + semsg(_(e_invalid_argument_str), name - 1); else { if (op != NULL && vim_strchr((char_u *)"+-*/%", *op) != NULL) @@ -1606,7 +1606,7 @@ ex_let_one( clear_lval(&lv); } else - semsg(_(e_invarg2), arg); + semsg(_(e_invalid_argument_str), arg); return arg_end; } @@ -1668,7 +1668,7 @@ ex_unletlock( ++arg; if (get_env_len(&arg) == 0) { - semsg(_(e_invarg2), arg - 1); + semsg(_(e_invalid_argument_str), arg - 1); return; } if (!error && !eap->skip @@ -4016,7 +4016,7 @@ var_redir_start(char_u *name, int append) // Catch a bad name early. if (!eval_isnamec1(*name)) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return FAIL; } @@ -4044,7 +4044,7 @@ var_redir_start(char_u *name, int append) // Trailing characters are present after the variable name semsg(_(e_trailing_arg), redir_endp); else - semsg(_(e_invarg2), name); + semsg(_(e_invalid_argument_str), name); redir_endp = NULL; // don't store a value, only cleanup var_redir_stop(); return FAIL; diff --git a/src/evalwindow.c b/src/evalwindow.c index 4ac60265c..f86302684 100644 --- a/src/evalwindow.c +++ b/src/evalwindow.c @@ -928,7 +928,7 @@ f_win_splitmove(typval_T *argvars, typval_T *rettv) if (argvars[2].v_type != VAR_DICT || argvars[2].vval.v_dict == NULL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } @@ -1149,7 +1149,7 @@ f_winrestview(typval_T *argvars, typval_T *rettv UNUSED) if (argvars[0].v_type != VAR_DICT || (dict = argvars[0].vval.v_dict) == NULL) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else { if (dict_find(dict, (char_u *)"lnum", -1) != NULL) diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 8f7418b7f..25c1c8b2e 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -480,7 +480,7 @@ ex_sort(exarg_T *eap) } else { - semsg(_(e_invarg2), p); + semsg(_(e_invalid_argument_str), p); goto sortend; } } @@ -488,7 +488,7 @@ ex_sort(exarg_T *eap) // Can only have one of 'n', 'b', 'o' and 'x'. if (format_found > 1) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); goto sortend; } @@ -664,7 +664,7 @@ sortend: vim_free(sortbuf2); vim_regfree(regmatch.regprog); if (got_int) - emsg(_(e_interr)); + emsg(_(e_interrupted)); } /* @@ -1811,7 +1811,7 @@ ex_file(exarg_T *eap) || eap->line2 > 0 || eap->addr_count > 1)) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } @@ -1909,7 +1909,7 @@ do_write(exarg_T *eap) { if (eap->cmdidx == CMD_saveas) { - emsg(_(e_argreq)); + emsg(_(e_argument_required)); goto theend; } other = FALSE; @@ -4776,7 +4776,7 @@ outofmem: else if (!global_busy) { if (got_int) // interrupted - emsg(_(e_interr)); + emsg(_(e_interrupted)); else if (got_match) // did find something but nothing substituted msg(""); else if (subflags.do_error) // nothing found @@ -4845,7 +4845,7 @@ do_sub_msg( } if (got_int) { - emsg(_(e_interr)); + emsg(_(e_interrupted)); return TRUE; } return FALSE; @@ -4992,7 +4992,7 @@ ex_global(exarg_T *eap) * pass 2: execute the command for each line that has been marked */ if (got_int) - msg(_(e_interr)); + msg(_(e_interrupted)); else if (ndone == 0) { if (type == 'v') diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 3b293e968..0403143cf 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -1212,7 +1212,7 @@ do_cmdline( && !func_has_ended(real_cookie)))) { if (cstack.cs_flags[cstack.cs_idx] & CSF_TRY) - emsg(_(e_endtry)); + emsg(_(e_missing_endtry)); else if (cstack.cs_flags[cstack.cs_idx] & CSF_WHILE) emsg(_(e_missing_endwhile)); else if (cstack.cs_flags[cstack.cs_idx] & CSF_FOR) @@ -2216,7 +2216,7 @@ do_one_cmd( while (ea.arg[0] == '+' && ea.arg[1] == '+') if (getargopt(&ea) == FAIL && !ni) { - errormsg = _(e_invarg); + errormsg = _(e_invalid_argument); goto doend; } @@ -2400,7 +2400,7 @@ do_one_cmd( if (!ni && (ea.argt & EX_NEEDARG) && *ea.arg == NUL) { - errormsg = _(e_argreq); + errormsg = _(e_argument_required); goto doend; } @@ -5939,7 +5939,7 @@ get_tabpage_arg(exarg_T *eap) tab_number = tabpage_index(lastused_tabpage); else { - eap->errmsg = ex_errmsg(e_invargval, eap->arg); + eap->errmsg = ex_errmsg(e_invalid_value_for_argument_str, eap->arg); tab_number = 0; goto theend; } @@ -5947,7 +5947,7 @@ get_tabpage_arg(exarg_T *eap) || tab_number > LAST_TAB_NR) { // No numbers as argument. - eap->errmsg = ex_errmsg(e_invarg2, eap->arg); + eap->errmsg = ex_errmsg(e_invalid_argument_str, eap->arg); goto theend; } } @@ -5959,7 +5959,7 @@ get_tabpage_arg(exarg_T *eap) || tab_number == 0) { // No numbers as argument. - eap->errmsg = ex_errmsg(e_invarg2, eap->arg); + eap->errmsg = ex_errmsg(e_invalid_argument_str, eap->arg); goto theend; } tab_number = tab_number * relative + tabpage_index(curtab); @@ -5967,7 +5967,7 @@ get_tabpage_arg(exarg_T *eap) --tab_number; } if (tab_number < unaccept_arg0 || tab_number > LAST_TAB_NR) - eap->errmsg = ex_errmsg(e_invarg2, eap->arg); + eap->errmsg = ex_errmsg(e_invalid_argument_str, eap->arg); } else if (eap->addr_count > 0) { @@ -6678,7 +6678,7 @@ ex_tabnext(exarg_T *eap) || tab_number == 0) { // No numbers as argument. - eap->errmsg = ex_errmsg(e_invarg2, eap->arg); + eap->errmsg = ex_errmsg(e_invalid_argument_str, eap->arg); return; } } @@ -7415,7 +7415,7 @@ changedir_func( || pathcmp((char *)pdir, (char *)new_dir, -1) != 0; if (dir_differs && vim_chdir(new_dir)) { - emsg(_(e_failed)); + emsg(_(e_command_failed)); vim_free(pdir); } else @@ -7541,7 +7541,7 @@ ex_sleep(exarg_T *eap) { case 'm': break; case NUL: len *= 1000L; break; - default: semsg(_(e_invarg2), eap->arg); return; + default: semsg(_(e_invalid_argument_str), eap->arg); return; } // Hide the cursor if invoked with ! @@ -7635,7 +7635,7 @@ ex_winsize(exarg_T *eap) if (!isdigit(*arg)) { - semsg(_(e_invarg2), arg); + semsg(_(e_invalid_argument_str), arg); return; } w = getdigits(&arg); @@ -7659,7 +7659,7 @@ ex_wincmd(exarg_T *eap) // CTRL-W g and CTRL-W CTRL-G have an extra command character if (eap->arg[1] == NUL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } xchar = eap->arg[1]; @@ -7676,7 +7676,7 @@ ex_wincmd(exarg_T *eap) #endif '"') && eap->nextcmd == NULL) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else if (!eap->skip) { // Pass flags on for ":vertical wincmd ]". @@ -8039,7 +8039,7 @@ ex_later(exarg_T *eap) } if (*p != NUL) - semsg(_(e_invarg2), eap->arg); + semsg(_(e_invalid_argument_str), eap->arg); else undo_time(eap->cmdidx == CMD_earlier ? -count : count, sec, file, FALSE); @@ -8135,7 +8135,7 @@ ex_redir(exarg_T *eap) if (*arg != NUL) { redir_reg = 0; - semsg(_(e_invarg2), eap->arg); + semsg(_(e_invalid_argument_str), eap->arg); } } else if (*arg == '=' && arg[1] == '>') @@ -8162,7 +8162,7 @@ ex_redir(exarg_T *eap) // TODO: redirect to a buffer else - semsg(_(e_invarg2), eap->arg); + semsg(_(e_invalid_argument_str), eap->arg); } // Make sure redirection is not off. Can happen for cmdline completion @@ -8326,7 +8326,7 @@ ex_mark(exarg_T *eap) return; #endif if (*eap->arg == NUL) // No argument? - emsg(_(e_argreq)); + emsg(_(e_argument_required)); else if (eap->arg[1] != NUL) // more than one character? semsg(_(e_trailing_arg), eap->arg); else @@ -9322,7 +9322,7 @@ ex_behave(exarg_T *eap) set_option_value((char_u *)"keymodel", 0L, (char_u *)"", 0); } else - semsg(_(e_invarg2), eap->arg); + semsg(_(e_invalid_argument_str), eap->arg); } static int filetype_detect = FALSE; @@ -9417,7 +9417,7 @@ ex_filetype(exarg_T *eap) } } else - semsg(_(e_invarg2), arg); + semsg(_(e_invalid_argument_str), arg); } /* diff --git a/src/ex_eval.c b/src/ex_eval.c index cb3fbc635..f46904213 100644 --- a/src/ex_eval.c +++ b/src/ex_eval.c @@ -191,7 +191,7 @@ cause_errthrow( * interrupt exception is catchable by the innermost try conditional and * not replaced by an interrupt message error exception. */ - if (mesg == (char_u *)_(e_interr)) + if (mesg == (char_u *)_(e_interrupted)) { *ignore = TRUE; return TRUE; @@ -1387,12 +1387,12 @@ ex_endwhile(exarg_T *eap) if (eap->cmdidx == CMD_endwhile) { - err = e_while; + err = e_endwhile_without_while; csf = CSF_WHILE; } else { - err = e_for; + err = e_endfor_without_for; csf = CSF_FOR; } @@ -1415,7 +1415,7 @@ ex_endwhile(exarg_T *eap) if (!(fl & CSF_TRY)) eap->errmsg = _(e_missing_endif); else if (fl & CSF_FINALLY) - eap->errmsg = _(e_endtry); + eap->errmsg = _(e_missing_endtry); // Try to find the matching ":while" and report what's missing. for (idx = cstack->cs_idx; idx > 0; --idx) { @@ -1513,7 +1513,7 @@ ex_throw(exarg_T *eap) value = eval_to_string_skip(arg, eap, eap->skip); else { - emsg(_(e_argreq)); + emsg(_(e_argument_required)); value = NULL; } @@ -1706,7 +1706,7 @@ ex_catch(exarg_T *eap) if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0) { - eap->errmsg = _(e_catch); + eap->errmsg = _(e_catch_without_try); give_up = TRUE; } else @@ -1802,7 +1802,7 @@ ex_catch(exarg_T *eap) *end = save_char; p_cpo = save_cpo; if (regmatch.regprog == NULL) - semsg(_(e_invarg2), pat); + semsg(_(e_invalid_argument_str), pat); else { /* @@ -1870,7 +1870,7 @@ ex_finally(exarg_T *eap) return; if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0) - eap->errmsg = _(e_finally); + eap->errmsg = _(e_finally_without_try); else { if (!(cstack->cs_flags[cstack->cs_idx] & CSF_TRY)) @@ -1890,7 +1890,7 @@ ex_finally(exarg_T *eap) if (cstack->cs_flags[idx] & CSF_FINALLY) { // Give up for a multiple ":finally" and ignore it. - eap->errmsg = _(e_finally_dup); + eap->errmsg = _(e_multiple_finally); return; } rewind_conditionals(cstack, idx, CSF_WHILE | CSF_FOR, @@ -2002,7 +2002,7 @@ ex_endtry(exarg_T *eap) return; if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0) - eap->errmsg = _(e_no_endtry); + eap->errmsg = _(e_endtry_without_try); else { /* diff --git a/src/ex_getln.c b/src/ex_getln.c index 814681b1d..0be4503df 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -4200,7 +4200,7 @@ check_cedit(void) { n = string_to_key(p_cedit, FALSE); if (vim_isprintc(n)) - return e_invarg; + return e_invalid_argument; cedit_key = n; } return NULL; diff --git a/src/fileio.c b/src/fileio.c index 5a731a849..73c724321 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2406,7 +2406,7 @@ failed: { if (!(flags & READ_DUMMY)) { - filemess(curbuf, sfname, (char_u *)_(e_interr), 0); + filemess(curbuf, sfname, (char_u *)_(e_interrupted), 0); if (newfile) curbuf->b_p_ro = TRUE; // must use "w!" now } diff --git a/src/filepath.c b/src/filepath.c index f4bddf859..a9edf7d88 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -842,7 +842,7 @@ f_delete(typval_T *argvars, typval_T *rettv) name = tv_get_string(&argvars[0]); if (name == NULL || *name == NUL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } @@ -2267,7 +2267,7 @@ f_writefile(typval_T *argvars, typval_T *rettv) } else { - semsg(_(e_invarg2), + semsg(_(e_invalid_argument_str), _("writefile() first argument must be a List or a Blob")); return; } diff --git a/src/globals.h b/src/globals.h index 2341f2d23..98ad7106f 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1600,39 +1600,11 @@ EXTERN int netbeansSuppressNoLines INIT(= 0); // skip "No lines in buffer" #endif /* - * The error messages that can be shared are included here. - * Excluded are errors that are only used once and debugging messages. + * Some error messages that can be shared are included here. + * They should be moved to errors.h. */ -EXTERN char e_abort[] INIT(= N_("E470: Command aborted")); -EXTERN char e_argreq[] INIT(= N_("E471: Argument required")); -#ifdef FEAT_EVAL -EXTERN char e_catch[] INIT(= N_("E603: :catch without :try")); -EXTERN char e_finally[] INIT(= N_("E606: :finally without :try")); -EXTERN char e_finally_dup[] INIT(= N_("E607: multiple :finally")); -EXTERN char e_endtry[] INIT(= N_("E600: Missing :endtry")); -EXTERN char e_no_endtry[] INIT(= N_("E602: :endtry without :try")); -EXTERN char e_while[] INIT(= N_("E588: :endwhile without :while")); -EXTERN char e_for[] INIT(= N_("E588: :endfor without :for")); -#endif -EXTERN char e_failed[] INIT(= N_("E472: Command failed")); -#if defined(FEAT_GUI) && defined(FEAT_XFONTSET) -EXTERN char e_fontset[] INIT(= N_("E234: Unknown fontset: %s")); -#endif -#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) \ - || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_HAIKU) -EXTERN char e_font[] INIT(= N_("E235: Unknown font: %s")); -#endif -#if defined(FEAT_GUI_X11) && !defined(FEAT_GUI_GTK) -EXTERN char e_fontwidth[] INIT(= N_("E236: Font \"%s\" is not fixed-width")); -#endif -EXTERN char e_internal[] INIT(= N_("E473: Internal error")); EXTERN char e_intern2[] INIT(= N_("E685: Internal error: %s")); -EXTERN char e_interr[] INIT(= N_("Interrupted")); -EXTERN char e_invarg[] INIT(= N_("E474: Invalid argument")); -EXTERN char e_invarg2[] INIT(= N_("E475: Invalid argument: %s")); EXTERN char e_duparg2[] INIT(= N_("E983: Duplicate argument: %s")); -EXTERN char e_invargval[] INIT(= N_("E475: Invalid value for argument %s")); -EXTERN char e_invargNval[] INIT(= N_("E475: Invalid value for argument %s: %s")); #ifdef FEAT_SPELL EXTERN char e_no_spell[] INIT(= N_("E756: Spell checking is not possible")); #endif diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index 2d313f777..ba3993b59 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -5071,7 +5071,7 @@ gui_mch_get_font(char_u *name, int report_error) if (font == NULL) { if (report_error) - semsg(_((char *)e_font), name); + semsg(_((char *)e_unknown_font_str), name); return NULL; } diff --git a/src/gui_haiku.cc b/src/gui_haiku.cc index 6d973c565..1dd29b760 100644 --- a/src/gui_haiku.cc +++ b/src/gui_haiku.cc @@ -3847,7 +3847,7 @@ gui_mch_get_font( if (name == 0 && be_fixed_font == 0) { if (giveErrorIfMissing) - semsg(_(e_font), name); + semsg(_(e_unknown_font_str), name); return NOFONT; } @@ -3914,7 +3914,7 @@ gui_mch_get_font( if (count_font_styles(family) <= 0) { if (giveErrorIfMissing) - semsg(_(e_font), font->name); + semsg(_(e_unknown_font_str), font->name); delete font; return NOFONT; } diff --git a/src/gui_photon.c b/src/gui_photon.c index ea8e5e463..d48a1538f 100644 --- a/src/gui_photon.c +++ b/src/gui_photon.c @@ -2955,7 +2955,7 @@ gui_mch_get_font(char_u *vim_font_name, int report_error) } if (report_error) - semsg(e_font, vim_font_name); + semsg(e_unknown_font_str, vim_font_name); return FAIL; } diff --git a/src/gui_w32.c b/src/gui_w32.c index 4edce2e29..d5ffd16c9 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -1547,7 +1547,7 @@ gui_mch_get_font( if (get_logfont(&lf, name, NULL, giveErrorIfMissing) == OK) font = get_font_handle(&lf); if (font == NOFONT && giveErrorIfMissing) - semsg(_(e_font), name); + semsg(_(e_unknown_font_str), name); return font; } diff --git a/src/gui_x11.c b/src/gui_x11.c index 92bbfc36f..2e871770f 100644 --- a/src/gui_x11.c +++ b/src/gui_x11.c @@ -1887,7 +1887,7 @@ gui_mch_get_font(char_u *name, int giveErrorIfMissing) if (font == NULL) { if (giveErrorIfMissing) - semsg(_(e_font), name); + semsg(_(e_unknown_font_str), name); return NOFONT; } @@ -1911,7 +1911,7 @@ gui_mch_get_font(char_u *name, int giveErrorIfMissing) if (font->max_bounds.width != font->min_bounds.width) { - semsg(_(e_fontwidth), name); + semsg(_(e_font_str_is_not_fixed_width), name); XFreeFont(gui.dpy, font); return NOFONT; } @@ -2072,7 +2072,7 @@ gui_mch_get_fontset( if (fontset == NULL) { if (giveErrorIfMissing) - semsg(_(e_fontset), name); + semsg(_(e_unknown_fontset_str), name); return NOFONTSET; } diff --git a/src/highlight.c b/src/highlight.c index 9502428aa..c4f5c66c6 100644 --- a/src/highlight.c +++ b/src/highlight.c @@ -1579,7 +1579,7 @@ do_highlight( linep = vim_strchr(linep, '\''); if (linep == NULL) { - semsg(_(e_invarg2), key_start); + semsg(_(e_invalid_argument_str), key_start); error = TRUE; break; } diff --git a/src/indent.c b/src/indent.c index ed1b7998c..12020f834 100644 --- a/src/indent.c +++ b/src/indent.c @@ -44,7 +44,7 @@ tabstop_set(char_u *var, int **array) if (cp != end) emsg(_(e_positive)); else - semsg(_(e_invarg2), cp); + semsg(_(e_invalid_argument_str), cp); return FAIL; } } @@ -56,7 +56,7 @@ tabstop_set(char_u *var, int **array) ++valcount; continue; } - semsg(_(e_invarg2), var); + semsg(_(e_invalid_argument_str), var); return FAIL; } @@ -73,7 +73,7 @@ tabstop_set(char_u *var, int **array) // Catch negative values, overflow and ridiculous big values. if (n < 0 || n > 9999) { - semsg(_(e_invarg2), cp); + semsg(_(e_invalid_argument_str), cp); vim_free(*array); *array = NULL; return FAIL; @@ -1627,7 +1627,7 @@ ex_retab(exarg_T *eap) } if (new_ts < 0 || new_ts > 9999) { - semsg(_(e_invarg2), eap->arg); + semsg(_(e_invalid_argument_str), eap->arg); return; } if (new_ts == 0) @@ -1736,7 +1736,7 @@ ex_retab(exarg_T *eap) line_breakcheck(); } if (got_int) - emsg(_(e_interr)); + emsg(_(e_interrupted)); #ifdef FEAT_VARTABS // If a single value was given then it can be considered equal to @@ -2095,6 +2095,9 @@ fixthisline(int (*get_the_indent)(void)) } } +/* + * Fix indent for 'lisp' and 'cindent'. + */ void fix_indent(void) { diff --git a/src/insexpand.c b/src/insexpand.c index 3cefb3974..d006135d2 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -2746,7 +2746,7 @@ f_complete(typval_T *argvars, typval_T *rettv UNUSED) return; if (argvars[1].v_type != VAR_LIST || argvars[1].vval.v_list == NULL) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else { startcol = (int)tv_get_number_chk(&argvars[0], NULL); @@ -33,7 +33,7 @@ handle_mode(typval_T *item, jobopt_T *opt, ch_mode_T *modep, int jo) *modep = MODE_JSON; else { - semsg(_(e_invarg2), val); + semsg(_(e_invalid_argument_str), val); return FAIL; } return OK; @@ -57,7 +57,7 @@ handle_io(typval_T *item, ch_part_T part, jobopt_T *opt) opt->jo_io[part] = JIO_OUT; else { - semsg(_(e_invarg2), val); + semsg(_(e_invalid_argument_str), val); return FAIL; } return OK; @@ -220,7 +220,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) opt->jo_io_buf[part] = tv_get_number(item); if (opt->jo_io_buf[part] <= 0) { - semsg(_(e_invargNval), hi->hi_key, tv_get_string(item)); + semsg(_(e_invalid_value_for_argument_str_str), hi->hi_key, tv_get_string(item)); return FAIL; } if (buflist_findnr(opt->jo_io_buf[part]) == NULL) @@ -270,7 +270,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) *lp = tv_get_number(item); if (*lp < 0) { - semsg(_(e_invargNval), hi->hi_key, tv_get_string(item)); + semsg(_(e_invalid_value_for_argument_str_str), hi->hi_key, tv_get_string(item)); return FAIL; } } @@ -281,7 +281,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) opt->jo_set |= JO_CHANNEL; if (item->v_type != VAR_CHANNEL) { - semsg(_(e_invargval), "channel"); + semsg(_(e_invalid_value_for_argument_str), "channel"); return FAIL; } opt->jo_channel = item->vval.v_channel; @@ -294,7 +294,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) opt->jo_callback = get_callback(item); if (opt->jo_callback.cb_name == NULL) { - semsg(_(e_invargval), "callback"); + semsg(_(e_invalid_value_for_argument_str), "callback"); return FAIL; } } @@ -306,7 +306,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) opt->jo_out_cb = get_callback(item); if (opt->jo_out_cb.cb_name == NULL) { - semsg(_(e_invargval), "out_cb"); + semsg(_(e_invalid_value_for_argument_str), "out_cb"); return FAIL; } } @@ -318,7 +318,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) opt->jo_err_cb = get_callback(item); if (opt->jo_err_cb.cb_name == NULL) { - semsg(_(e_invargval), "err_cb"); + semsg(_(e_invalid_value_for_argument_str), "err_cb"); return FAIL; } } @@ -330,7 +330,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) opt->jo_close_cb = get_callback(item); if (opt->jo_close_cb.cb_name == NULL) { - semsg(_(e_invargval), "close_cb"); + semsg(_(e_invalid_value_for_argument_str), "close_cb"); return FAIL; } } @@ -343,7 +343,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) never = TRUE; else if (STRCMP(val, "auto") != 0) { - semsg(_(e_invargNval), "drop", val); + semsg(_(e_invalid_value_for_argument_str_str), "drop", val); return FAIL; } opt->jo_drop_never = never; @@ -356,7 +356,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) opt->jo_exit_cb = get_callback(item); if (opt->jo_exit_cb.cb_name == NULL) { - semsg(_(e_invargval), "exit_cb"); + semsg(_(e_invalid_value_for_argument_str), "exit_cb"); return FAIL; } } @@ -370,7 +370,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) opt->jo_term_name_buf); if (opt->jo_term_name == NULL) { - semsg(_(e_invargval), "term_name"); + semsg(_(e_invalid_value_for_argument_str), "term_name"); return FAIL; } } @@ -381,7 +381,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) val = tv_get_string(item); if (STRCMP(val, "open") != 0 && STRCMP(val, "close") != 0) { - semsg(_(e_invargNval), "term_finish", val); + semsg(_(e_invalid_value_for_argument_str_str), "term_finish", val); return FAIL; } opt->jo_set2 |= JO2_TERM_FINISH; @@ -406,7 +406,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) } if (p == NULL) { - semsg(_(e_invargval), "term_opencmd"); + semsg(_(e_invalid_value_for_argument_str), "term_opencmd"); return FAIL; } } @@ -419,7 +419,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) opt->jo_eof_chars_buf); if (opt->jo_eof_chars == NULL) { - semsg(_(e_invargval), "eof_chars"); + semsg(_(e_invalid_value_for_argument_str), "eof_chars"); return FAIL; } } @@ -435,7 +435,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) return FAIL; if (opt->jo_term_rows < 0 || opt->jo_term_rows > 1000) { - semsg(_(e_invargval), "term_rows"); + semsg(_(e_invalid_value_for_argument_str), "term_rows"); return FAIL; } } @@ -470,7 +470,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) nr = tv_get_number(item); if (nr <= 0) { - semsg(_(e_invargNval), hi->hi_key, tv_get_string(item)); + semsg(_(e_invalid_value_for_argument_str_str), hi->hi_key, tv_get_string(item)); return FAIL; } opt->jo_bufnr_buf = buflist_findnr(nr); @@ -482,7 +482,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) if (opt->jo_bufnr_buf->b_nwindows == 0 || opt->jo_bufnr_buf->b_term == NULL) { - semsg(_(e_invarg2), "bufnr"); + semsg(_(e_invalid_argument_str), "bufnr"); return FAIL; } } @@ -509,7 +509,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) opt->jo_term_kill_buf); if (opt->jo_term_kill == NULL) { - semsg(_(e_invargval), "term_kill"); + semsg(_(e_invalid_value_for_argument_str), "term_kill"); return FAIL; } } @@ -523,14 +523,14 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) p = tv_get_string_chk(item); if (p == NULL) { - semsg(_(e_invargval), "tty_type"); + semsg(_(e_invalid_value_for_argument_str), "tty_type"); return FAIL; } // Allow empty string, "winpty", "conpty". if (!(*p == NUL || STRCMP(p, "winpty") == 0 || STRCMP(p, "conpty") == 0)) { - semsg(_(e_invargval), "tty_type"); + semsg(_(e_invalid_value_for_argument_str), "tty_type"); return FAIL; } opt->jo_tty_type = p[0]; @@ -548,7 +548,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) if (item == NULL || item->v_type != VAR_LIST || item->vval.v_list == NULL) { - semsg(_(e_invargval), "ansi_colors"); + semsg(_(e_invalid_value_for_argument_str), "ansi_colors"); return FAIL; } @@ -578,7 +578,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) if (n != 16 || li != NULL) { - semsg(_(e_invargval), "ansi_colors"); + semsg(_(e_invalid_value_for_argument_str), "ansi_colors"); return FAIL; } @@ -596,7 +596,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) p = tv_get_string_buf_chk(item, opt->jo_term_highlight_buf); if (p == NULL || *p == NUL) { - semsg(_(e_invargval), "term_highlight"); + semsg(_(e_invalid_value_for_argument_str), "term_highlight"); return FAIL; } opt->jo_term_highlight = p; @@ -610,7 +610,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) opt->jo_term_api_buf); if (opt->jo_term_api == NULL) { - semsg(_(e_invargval), "term_api"); + semsg(_(e_invalid_value_for_argument_str), "term_api"); return FAIL; } } @@ -621,7 +621,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) break; if (item->v_type != VAR_DICT) { - semsg(_(e_invargval), "env"); + semsg(_(e_invalid_value_for_argument_str), "env"); return FAIL; } opt->jo_set2 |= JO2_ENV; @@ -640,7 +640,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) #endif ) { - semsg(_(e_invargval), "cwd"); + semsg(_(e_invalid_value_for_argument_str), "cwd"); return FAIL; } opt->jo_set2 |= JO2_CWD; @@ -685,7 +685,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) opt->jo_part = PART_OUT; else { - semsg(_(e_invargNval), "part", val); + semsg(_(e_invalid_value_for_argument_str_str), "part", val); return FAIL; } } @@ -705,7 +705,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) opt->jo_stoponexit_buf); if (opt->jo_stoponexit == NULL) { - semsg(_(e_invargval), "stoponexit"); + semsg(_(e_invalid_value_for_argument_str), "stoponexit"); return FAIL; } } @@ -722,7 +722,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) } if (todo > 0) { - semsg(_(e_invarg2), hi->hi_key); + semsg(_(e_invalid_argument_str), hi->hi_key); return FAIL; } @@ -1385,7 +1385,7 @@ job_start( cmd = argvars[0].vval.v_string; if (cmd == NULL || *skipwhite(cmd) == NUL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); goto theend; } @@ -1396,7 +1396,7 @@ job_start( || argvars[0].vval.v_list == NULL || argvars[0].vval.v_list->lv_len < 1) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); goto theend; } else @@ -1409,7 +1409,7 @@ job_start( // Empty command is invalid. if (argc == 0 || *skipwhite((char_u *)argv[0]) == NUL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); goto theend; } #ifndef USE_ARGV @@ -1418,7 +1418,7 @@ job_start( cmd = ga.ga_data; if (cmd == NULL || *skipwhite(cmd) == NUL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); goto theend; } #endif @@ -1512,7 +1512,7 @@ job_stop(job_T *job, typval_T *argvars, char *type) arg = tv_get_string_chk(&argvars[1]); if (arg == NULL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return 0; } } @@ -1775,7 +1775,7 @@ get_job_arg(typval_T *tv) if (tv->v_type != VAR_JOB) { - semsg(_(e_invarg2), tv_get_string(tv)); + semsg(_(e_invalid_argument_str), tv_get_string(tv)); return NULL; } job = tv->vval.v_job; diff --git a/src/json.c b/src/json.c index a8d3a090f..78a3a8ee1 100644 --- a/src/json.c +++ b/src/json.c @@ -933,7 +933,7 @@ json_decode_item(js_read_T *reader, typval_T *res, int options) top_item->jd_key = tv_get_string_buf_chk(cur_item, key_buf); if (top_item->jd_key == NULL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); retval = FAIL; goto theend; } @@ -1164,7 +1164,7 @@ f_js_decode(typval_T *argvars, typval_T *rettv) reader.js_fill = NULL; reader.js_used = 0; if (json_decode_all(&reader, rettv, JSON_JS) != OK) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); } /* diff --git a/src/list.c b/src/list.c index 838991b73..42f9765a5 100644 --- a/src/list.c +++ b/src/list.c @@ -1658,7 +1658,7 @@ f_list2str(typval_T *argvars, typval_T *rettv) if (argvars[0].v_type != VAR_LIST) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } @@ -2128,7 +2128,7 @@ parse_sort_uniq_args(typval_T *argvars, sortinfo_T *info) info->item_compare_func = tv_get_string(&argvars[1]); else if (nr != 0) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return FAIL; } } @@ -2670,7 +2670,7 @@ f_count(typval_T *argvars, typval_T *rettv) { if (argvars[2].v_type != VAR_UNKNOWN && argvars[3].v_type != VAR_UNKNOWN) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else n = dict_count(argvars[0].vval.v_dict, &argvars[1], ic); } @@ -916,7 +916,7 @@ map_clear( local = (STRCMP(arg, "<buffer>") == 0); if (!local && *arg != NUL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } @@ -2753,7 +2753,7 @@ do_exmap(exarg_T *eap, int isabbrev) switch (do_map((*cmdp == 'n') ? 2 : (*cmdp == 'u'), eap->arg, mode, isabbrev)) { - case 1: emsg(_(e_invarg)); + case 1: emsg(_(e_invalid_argument)); break; case 2: emsg((isabbrev ? _(e_no_such_abbreviation) : _(e_no_such_mapping))); diff --git a/src/mark.c b/src/mark.c index 867833f15..dc9bece44 100644 --- a/src/mark.c +++ b/src/mark.c @@ -787,9 +787,9 @@ ex_delmarks(exarg_T *eap) // clear all marks clrallmarks(curbuf); else if (eap->forceit) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else if (*eap->arg == NUL) - emsg(_(e_argreq)); + emsg(_(e_argument_required)); else { // clear specified marks only @@ -809,7 +809,7 @@ ex_delmarks(exarg_T *eap) : ASCII_ISUPPER(p[2]))) || to < from) { - semsg(_(e_invarg2), p); + semsg(_(e_invalid_argument_str), p); return; } p += 2; @@ -848,7 +848,7 @@ ex_delmarks(exarg_T *eap) case '<': curbuf->b_visual.vi_start.lnum = 0; break; case '>': curbuf->b_visual.vi_end.lnum = 0; break; case ' ': break; - default: semsg(_(e_invarg2), p); + default: semsg(_(e_invalid_argument_str), p); return; } } diff --git a/src/match.c b/src/match.c index 3b5c18e42..f1c7442a5 100644 --- a/src/match.c +++ b/src/match.c @@ -69,7 +69,7 @@ match_add( } if (pat != NULL && (regprog = vim_regcomp(pat, RE_MAGIC)) == NULL) { - semsg(_(e_invarg2), pat); + semsg(_(e_invalid_argument_str), pat); return -1; } @@ -1087,7 +1087,7 @@ f_setmatches(typval_T *argvars UNUSED, typval_T *rettv UNUSED) if (li->li_tv.v_type != VAR_DICT || (d = li->li_tv.vval.v_dict) == NULL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } if (!(dict_find(d, (char_u *)"group", -1) != NULL @@ -1096,7 +1096,7 @@ f_setmatches(typval_T *argvars UNUSED, typval_T *rettv UNUSED) && dict_find(d, (char_u *)"priority", -1) != NULL && dict_find(d, (char_u *)"id", -1) != NULL)) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } li = li->li_next; @@ -1394,7 +1394,7 @@ ex_match(exarg_T *eap) { // There must be two arguments. vim_free(g); - semsg(_(e_invarg2), eap->arg); + semsg(_(e_invalid_argument_str), eap->arg); return; } end = skip_regexp(p + 1, *p, TRUE); @@ -1409,7 +1409,7 @@ ex_match(exarg_T *eap) if (*end != *p) { vim_free(g); - semsg(_(e_invarg2), p); + semsg(_(e_invalid_argument_str), p); return; } diff --git a/src/mbyte.c b/src/mbyte.c index 0e9c92653..bbbb5066d 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -530,7 +530,7 @@ codepage_invalid: // Windows: accept only valid codepage numbers, check below. if (p_enc[6] != 'c' || p_enc[7] != 'p' || (enc_dbcs_new = atoi((char *)p_enc + 8)) == 0) - return e_invarg; + return e_invalid_argument; #else // Unix: accept any "2byte-" name, assume current locale. enc_dbcs_new = DBCS_2BYTE; @@ -563,7 +563,7 @@ codepage_invalid: } } else // Don't know what encoding this is, reject it. - return e_invarg; + return e_invalid_argument; if (enc_dbcs_new != 0) { diff --git a/src/menu.c b/src/menu.c index c0a1f3a71..e821b0580 100644 --- a/src/menu.c +++ b/src/menu.c @@ -273,7 +273,7 @@ ex_menu( menu_path = arg; if (*menu_path == '.') { - semsg(_(e_invarg2), menu_path); + semsg(_(e_invalid_argument_str), menu_path); goto theend; } @@ -2508,7 +2508,7 @@ ex_emenu(exarg_T *eap) case 't': mode_idx = MENU_INDEX_TERMINAL; break; case 'i': mode_idx = MENU_INDEX_INSERT; break; case 'c': mode_idx = MENU_INDEX_CMDLINE; break; - default: semsg(_(e_invarg2), arg); + default: semsg(_(e_invalid_argument_str), arg); return; } arg = skipwhite(arg + 2); @@ -2698,7 +2698,7 @@ ex_menutranslate(exarg_T *eap UNUSED) if (arg == to || ends_excmd2(eap->arg, from) || ends_excmd2(eap->arg, to) || !ends_excmd2(eap->arg, skipwhite(arg))) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else { if (ga_grow(&menutrans_ga, 1) == OK) diff --git a/src/message.c b/src/message.c index 8768065bb..36e454845 100644 --- a/src/message.c +++ b/src/message.c @@ -1051,7 +1051,7 @@ ex_messages(exarg_T *eap) if (*eap->arg != NUL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } diff --git a/src/misc2.c b/src/misc2.c index 4400d4aa5..3a8012a4a 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -1375,7 +1375,7 @@ find_special_key( vim_str2nr(bp + 5, NULL, &l, STR2NR_ALL, NULL, NULL, 0, TRUE); if (l == 0) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return 0; } bp += l + 5; @@ -1413,7 +1413,7 @@ find_special_key( &n, 0, TRUE); if (l == 0) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return 0; } key = (int)n; @@ -745,7 +745,7 @@ op_delete(oparg_T *oap) msg_silent = msg_silent_save; if (n != 'y') { - emsg(_(e_abort)); + emsg(_(e_command_aborted)); return FAIL; } } diff --git a/src/option.c b/src/option.c index 2aab253eb..2f81f8bb9 100644 --- a/src/option.c +++ b/src/option.c @@ -1325,7 +1325,7 @@ do_set( } if (arg[len] != '>') { - errmsg = e_invarg; + errmsg = e_invalid_argument; goto skip; } arg[len] = NUL; // put NUL after name @@ -1577,7 +1577,7 @@ do_set( { if (nextchar == '=' || nextchar == ':') { - errmsg = e_invarg; + errmsg = e_invalid_argument; goto skip; } @@ -1627,7 +1627,7 @@ do_set( if (vim_strchr((char_u *)"=:&<", nextchar) == NULL || prefix != 1) { - errmsg = e_invarg; + errmsg = e_invalid_argument; goto skip; } @@ -1669,7 +1669,7 @@ do_set( value = string_to_key(arg, FALSE); if (value == 0 && (long *)varp != &p_wcm) { - errmsg = e_invarg; + errmsg = e_invalid_argument; goto skip; } } @@ -3471,7 +3471,7 @@ set_num_option( } else if (curwin->w_p_fdc > 12) { - errmsg = e_invarg; + errmsg = e_invalid_argument; curwin->w_p_fdc = 12; } } @@ -3508,7 +3508,7 @@ set_num_option( { if (curbuf->b_p_iminsert < 0 || curbuf->b_p_iminsert > B_IMODE_LAST) { - errmsg = e_invarg; + errmsg = e_invalid_argument; curbuf->b_p_iminsert = B_IMODE_NONE; } p_iminsert = curbuf->b_p_iminsert; @@ -3525,7 +3525,7 @@ set_num_option( else if (pp == &p_imst) { if (p_imst != IM_ON_THE_SPOT && p_imst != IM_OVER_THE_SPOT) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #endif @@ -3541,7 +3541,7 @@ set_num_option( { if (curbuf->b_p_imsearch < -1 || curbuf->b_p_imsearch > B_IMODE_LAST) { - errmsg = e_invarg; + errmsg = e_invalid_argument; curbuf->b_p_imsearch = B_IMODE_NONE; } p_imsearch = curbuf->b_p_imsearch; @@ -3601,7 +3601,7 @@ set_num_option( } else if (curwin->w_p_cole > 3) { - errmsg = e_invarg; + errmsg = e_invalid_argument; curwin->w_p_cole = 3; } } @@ -3616,7 +3616,7 @@ set_num_option( else if (pp == &p_pyx) { if (p_pyx != 0 && p_pyx != 2 && p_pyx != 3) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #endif @@ -3647,7 +3647,7 @@ set_num_option( } if (curwin->w_p_nuw > 20) { - errmsg = e_invarg; + errmsg = e_invalid_argument; curwin->w_p_nuw = 20; } curwin->w_nrwidth_line_count = 0; // trigger a redraw @@ -3759,12 +3759,12 @@ set_num_option( } else if (p_hi > 10000) { - errmsg = e_invarg; + errmsg = e_invalid_argument; p_hi = 10000; } if (p_re < 0 || p_re > 2) { - errmsg = e_invarg; + errmsg = e_invalid_argument; p_re = 0; } if (p_report < 0) diff --git a/src/optionstr.c b/src/optionstr.c index ae584d02b..85405edec 100644 --- a/src/optionstr.c +++ b/src/optionstr.c @@ -687,7 +687,7 @@ did_set_string_option( ? "/\\*?[|;&<>\r\n" : "/\\*?[<>\r\n")) != NULL) || ((get_option_flags(opt_idx) & P_NDNAME) && vim_strpbrk(*varp, (char_u *)"*?[|;&<>\r\n") != NULL)) - errmsg = e_invarg; + errmsg = e_invalid_argument; // 'term' else if (varp == &T_NAME) @@ -732,14 +732,14 @@ did_set_string_option( else { if (opt_strings_flags(bkc, p_bkc_values, flags, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; if ((((int)*flags & BKC_AUTO) != 0) + (((int)*flags & BKC_YES) != 0) + (((int)*flags & BKC_NO) != 0) != 1) { // Must have exactly one of "auto", "yes" and "no". (void)opt_strings_flags(oldval, p_bkc_values, flags, TRUE); - errmsg = e_invarg; + errmsg = e_invalid_argument; } } } @@ -756,7 +756,7 @@ did_set_string_option( else if (varp == &curwin->w_p_briopt) { if (briopt_check(curwin) == FAIL) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #endif @@ -771,7 +771,7 @@ did_set_string_option( if (init_chartab() == FAIL) { did_chartab = TRUE; // need to restore it below - errmsg = e_invarg; // error in value + errmsg = e_invalid_argument; // error in value } } @@ -797,7 +797,7 @@ did_set_string_option( || gvarp == &curwin->w_allbuf_opt.wo_culopt) { if (**varp == NUL || fill_culopt_flags(*varp, curwin) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'colorcolumn' @@ -814,7 +814,7 @@ did_set_string_option( { if (s[1] == NUL || ((s[2] != ',' || s[3] == NUL) && s[2] != NUL)) { - errmsg = e_invarg; + errmsg = e_invalid_argument; break; } if (s[2] == NUL) @@ -827,14 +827,14 @@ did_set_string_option( else if (varp == &p_hl) { if (highlight_changed() == FAIL) - errmsg = e_invarg; // invalid flags + errmsg = e_invalid_argument; // invalid flags } // 'nrformats' else if (gvarp == &p_nf) { if (check_opt_strings(*varp, p_nf_values, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #ifdef FEAT_SESSION @@ -842,19 +842,19 @@ did_set_string_option( else if (varp == &p_ssop) { if (opt_strings_flags(p_ssop, p_ssop_values, &ssop_flags, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; if ((ssop_flags & SSOP_CURDIR) && (ssop_flags & SSOP_SESDIR)) { // Don't allow both "sesdir" and "curdir". (void)opt_strings_flags(oldval, p_ssop_values, &ssop_flags, TRUE); - errmsg = e_invarg; + errmsg = e_invalid_argument; } } // 'viewoptions' else if (varp == &p_vop) { if (opt_strings_flags(p_vop, p_ssop_values, &vop_flags, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #endif @@ -862,14 +862,14 @@ did_set_string_option( else if (varp == &p_sbo) { if (check_opt_strings(p_sbo, p_scbopt_values, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'ambiwidth' else if (varp == &p_ambw || varp == &p_emoji) { if (check_opt_strings(p_ambw, p_ambw_values, FALSE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; else if (set_chars_option(curwin, &p_fcs) != NULL) errmsg = _(e_conflicts_with_value_of_fillchars); else @@ -920,21 +920,21 @@ ambw_end: #endif } else - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'wildmode' else if (varp == &p_wim) { if (check_opt_wim() == FAIL) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'wildoptions' else if (varp == &p_wop) { if (check_opt_strings(p_wop, p_wop_values, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #ifdef FEAT_WAK @@ -943,7 +943,7 @@ ambw_end: { if (*p_wak == NUL || check_opt_strings(p_wak, p_wak_values, FALSE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; # ifdef FEAT_MENU # ifdef FEAT_GUI_MOTIF else if (gui.in_use) @@ -962,7 +962,7 @@ ambw_end: else if (varp == &p_ei) { if (check_ei() == FAIL) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'encoding', 'fileencoding', 'termencoding' and 'makeencoding' @@ -976,7 +976,7 @@ ambw_end: else if (vim_strchr(*varp, ',') != NULL) // No comma allowed in 'fileencoding'; catches confusing it // with 'fileencodings'. - errmsg = e_invarg; + errmsg = e_invalid_argument; else { // May show a "+" in the title now. @@ -1029,7 +1029,7 @@ ambw_end: { semsg(_("E950: Cannot convert between %s and %s"), p_tenc, p_enc); - errmsg = e_invarg; + errmsg = e_invalid_argument; } } @@ -1069,7 +1069,7 @@ ambw_end: else if (varp == &p_imak) { if (!im_xim_isvalid_imactivate()) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #endif @@ -1077,7 +1077,7 @@ ambw_end: else if (varp == &curbuf->b_p_keymap) { if (!valid_filetype(*varp)) - errmsg = e_invarg; + errmsg = e_invalid_argument; else { int secure_save = secure; @@ -1129,7 +1129,7 @@ ambw_end: if (!curbuf->b_p_ma && !(opt_flags & OPT_GLOBAL)) errmsg = e_cannot_make_changes_modifiable_is_off; else if (check_opt_strings(*varp, p_ff_values, FALSE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; else { // may also change 'textmode' @@ -1151,7 +1151,7 @@ ambw_end: else if (varp == &p_ffs) { if (check_opt_strings(p_ffs, p_ff_values, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; else { // also change 'textauto' @@ -1186,9 +1186,9 @@ ambw_end: else p = p_cm; if (check_opt_strings(p, p_cm_values, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; else if (crypt_self_test() == FAIL) - errmsg = e_invarg; + errmsg = e_invalid_argument; else { // When setting the global value to empty, make it "zip". @@ -1257,7 +1257,7 @@ ambw_end: } if (x2 != ':' || x3 == -1 || (*p != NUL && *p != ',')) { - errmsg = e_invarg; + errmsg = e_invalid_argument; break; } if (*p == NUL) @@ -1271,7 +1271,7 @@ ambw_end: { if (p[1] != ':' || p[2] == NUL || (p[3] != NUL && p[3] != ',')) { - errmsg = e_invarg; + errmsg = e_invalid_argument; break; } if (p[3] == NUL) @@ -1356,7 +1356,7 @@ ambw_end: { verbose_stop(); if (*p_vfile != NUL && verbose_open() == FAIL) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #ifdef FEAT_VIMINFO @@ -1643,7 +1643,7 @@ ambw_end: // that. mch_setmouse(FALSE); if (opt_strings_flags(p_ttym, p_ttym_values, &ttym_flags, FALSE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; else check_mouse_termcode(); if (termcap_active) @@ -1656,14 +1656,14 @@ ambw_end: { if (*p_sel == NUL || check_opt_strings(p_sel, p_sel_values, FALSE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'selectmode' else if (varp == &p_slm) { if (check_opt_strings(p_slm, p_slm_values, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #ifdef FEAT_BROWSE @@ -1672,7 +1672,7 @@ ambw_end: { if (check_opt_strings(p_bsdir, p_bsdir_values, FALSE) != OK && !mch_isdir(p_bsdir)) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #endif @@ -1680,7 +1680,7 @@ ambw_end: else if (varp == &p_km) { if (check_opt_strings(p_km, p_km_values, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; else { km_stopsel = (vim_strchr(p_km, 'o') != NULL); @@ -1692,7 +1692,7 @@ ambw_end: else if (varp == &p_mousem) { if (check_opt_strings(p_mousem, p_mousem_values, FALSE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; #if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU) && (XmVersion <= 1002) else if (*p_mousem != *oldval) // Changed from "extend" to "popup" or "popup_setpos" or vv: need @@ -1705,21 +1705,21 @@ ambw_end: else if (varp == &p_swb) { if (opt_strings_flags(p_swb, p_swb_values, &swb_flags, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'debug' else if (varp == &p_debug) { if (check_opt_strings(p_debug, p_debug_values, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'display' else if (varp == &p_dy) { if (opt_strings_flags(p_dy, p_dy_values, &dy_flags, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; else (void)init_chartab(); @@ -1729,7 +1729,7 @@ ambw_end: else if (varp == &p_ead) { if (check_opt_strings(p_ead, p_ead_values, FALSE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #ifdef FEAT_CLIPBOARD @@ -1748,7 +1748,7 @@ ambw_end: if ((is_spellfile && !valid_spellfile(*varp)) || (!is_spellfile && !valid_spelllang(*varp))) - errmsg = e_invarg; + errmsg = e_invalid_argument; else errmsg = did_set_spell_option(is_spellfile); } @@ -1761,19 +1761,19 @@ ambw_end: else if (varp == &(curwin->w_s->b_p_spo)) { if (**varp != NUL && STRCMP("camel", *varp) != 0) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'spellsuggest' else if (varp == &p_sps) { if (spell_check_sps() != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'mkspellmem' else if (varp == &p_msm) { if (spell_check_msm() != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #endif @@ -1781,14 +1781,14 @@ ambw_end: else if (gvarp == &p_bh) { if (check_opt_strings(curbuf->b_p_bh, p_bufhidden_values, FALSE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // When 'buftype' is set, check for valid value. else if (gvarp == &p_bt) { if (check_opt_strings(curbuf->b_p_bt, p_buftype_values, FALSE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; else { if (curwin->w_status_height) @@ -1876,7 +1876,7 @@ ambw_end: else if (varp == &p_cot) { if (check_opt_strings(p_cot, p_cot_values, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; else completeopt_was_set(); } @@ -1887,7 +1887,7 @@ ambw_end: { if (check_opt_strings(p_csl, p_csl_values, FALSE) != OK || check_opt_strings(curbuf->b_p_csl, p_csl_values, FALSE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #endif @@ -1896,7 +1896,7 @@ ambw_end: else if (varp == &curwin->w_p_scl) { if (check_opt_strings(*varp, p_scl_values, FALSE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; // When changing the 'signcolumn' to or from 'number', recompute the // width of the number column if 'number' or 'relativenumber' is set. if (((*oldval == 'n' && *(oldval + 1) == 'u') @@ -1913,7 +1913,7 @@ ambw_end: { if (opt_strings_flags(p_toolbar, p_toolbar_values, &toolbar_flags, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; else { out_flush(); @@ -1928,7 +1928,7 @@ ambw_end: else if (varp == &p_tbis) { if (opt_strings_flags(p_tbis, p_tbis_values, &tbis_flags, FALSE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; else { out_flush(); @@ -1961,15 +1961,15 @@ ambw_end: if (VIM_ISDIGIT(*p_bs)) { if (*p_bs > '3' || p_bs[1] != NUL) - errmsg = e_invarg; + errmsg = e_invalid_argument; } else if (check_opt_strings(p_bs, p_bs_values, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } else if (varp == &p_bo) { if (opt_strings_flags(p_bo, p_bo_values, &bo_flags, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'tagcase' @@ -1993,14 +1993,14 @@ ambw_end: *flags = 0; else if (*p == NUL || opt_strings_flags(p, p_tc_values, flags, FALSE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'casemap' else if (varp == &p_cmp) { if (opt_strings_flags(p_cmp, p_cmp_values, &cmp_flags, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #ifdef FEAT_DIFF @@ -2008,7 +2008,7 @@ ambw_end: else if (varp == &p_dip) { if (diffopt_changed() == FAIL) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #endif @@ -2018,7 +2018,7 @@ ambw_end: { if (check_opt_strings(*varp, p_fdm_values, FALSE) != OK || *curwin->w_p_fdm == NUL) - errmsg = e_invarg; + errmsg = e_invalid_argument; else { foldUpdateAll(curwin); @@ -2033,7 +2033,7 @@ ambw_end: if (p == NULL) errmsg = N_("E536: comma required"); else if (p == *varp || p[1] == NUL) - errmsg = e_invarg; + errmsg = e_invalid_argument; else if (foldmethodIsMarker(curwin)) foldUpdateAll(curwin); } @@ -2047,13 +2047,13 @@ ambw_end: else if (varp == &p_fdo) { if (opt_strings_flags(p_fdo, p_fdo_values, &fdo_flags, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'foldclose' else if (varp == &p_fcl) { if (check_opt_strings(p_fcl, p_fcl_values, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'foldignore' else if (gvarp == &curwin->w_allbuf_opt.wo_fdi) @@ -2081,7 +2081,7 @@ ambw_end: else { if (opt_strings_flags(ve, p_ve_values, flags, TRUE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; else if (STRCMP(p_ve, oldval) != 0) { // Recompute cursor position in case the new 've' setting @@ -2105,7 +2105,7 @@ ambw_end: || vim_strchr((char_u *)CSQF_FLAGS, p[1]) == NULL || (p[2] != NUL && p[2] != ',')) { - errmsg = e_invarg; + errmsg = e_invalid_argument; break; } else if (p[2] == NUL) @@ -2131,14 +2131,14 @@ ambw_end: else if (varp == &p_rop) { if (!gui_mch_set_rendering_options(p_rop)) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #endif else if (gvarp == &p_ft) { if (!valid_filetype(*varp)) - errmsg = e_invarg; + errmsg = e_invalid_argument; else { value_changed = STRCMP(oldval, *varp) != 0; @@ -2153,7 +2153,7 @@ ambw_end: else if (gvarp == &p_syn) { if (!valid_filetype(*varp)) - errmsg = e_invarg; + errmsg = e_invalid_argument; else { value_changed = STRCMP(oldval, *varp) != 0; @@ -2171,7 +2171,7 @@ ambw_end: { if (*curwin->w_p_twk != NUL && string_to_key(curwin->w_p_twk, TRUE) == 0) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'termwinsize' else if (varp == &curwin->w_p_tws) @@ -2182,7 +2182,7 @@ ambw_end: if (p == curwin->w_p_tws || (*p != 'x' && *p != '*') || *skipdigits(p + 1) != NUL) - errmsg = e_invarg; + errmsg = e_invalid_argument; } } // 'wincolor' @@ -2193,7 +2193,7 @@ ambw_end: else if (varp == &p_twt) { if (check_opt_strings(*varp, p_twt_values, FALSE) != OK) - errmsg = e_invarg; + errmsg = e_invalid_argument; } # endif #endif @@ -2220,7 +2220,7 @@ ambw_end: continue; if (*cp == ',' && cp > *varp && *(cp-1) != ',') continue; - errmsg = e_invarg; + errmsg = e_invalid_argument; break; } if (errmsg == NULL) @@ -2232,7 +2232,7 @@ ambw_end: vim_free(oldarray); } else - errmsg = e_invarg; + errmsg = e_invalid_argument; } } } @@ -2258,7 +2258,7 @@ ambw_end: continue; if (*cp == ',' && cp > *varp && *(cp-1) != ',') continue; - errmsg = e_invarg; + errmsg = e_invalid_argument; break; } if (errmsg == NULL) @@ -2274,7 +2274,7 @@ ambw_end: #endif } else - errmsg = e_invarg; + errmsg = e_invalid_argument; } } } @@ -2285,14 +2285,14 @@ ambw_end: else if (varp == &p_pvp) { if (parse_previewpopup(NULL) == FAIL) - errmsg = e_invarg; + errmsg = e_invalid_argument; } # ifdef FEAT_QUICKFIX // 'completepopup' else if (varp == &p_cpp) { if (parse_completepopup(NULL) == FAIL) - errmsg = e_invarg; + errmsg = e_invalid_argument; else popup_close_info(); } @@ -2390,21 +2390,21 @@ ambw_end: else if (gvarp == &p_cfu) { if (set_completefunc_option() == FAIL) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'omnifunc' else if (gvarp == &p_ofu) { if (set_omnifunc_option() == FAIL) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'thesaurusfunc' else if (gvarp == &p_tsrfu) { if (set_thesaurusfunc_option() == FAIL) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #endif @@ -2414,14 +2414,14 @@ ambw_end: else if (gvarp == &p_imaf) { if (set_imactivatefunc_option() == FAIL) - errmsg = e_invarg; + errmsg = e_invalid_argument; } // 'imstatusfunc' else if (gvarp == &p_imsf) { if (set_imstatusfunc_option() == FAIL) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #endif @@ -2429,7 +2429,7 @@ ambw_end: else if (varp == &p_opfunc) { if (set_operatorfunc_option() == FAIL) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #ifdef FEAT_QUICKFIX @@ -2437,7 +2437,7 @@ ambw_end: else if (varp == &p_qftf) { if (qf_process_qftf_option() == FAIL) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #endif @@ -2446,7 +2446,7 @@ ambw_end: else if (gvarp == &p_tfu) { if (set_tagfunc_option() == FAIL) - errmsg = e_invarg; + errmsg = e_invalid_argument; } #endif diff --git a/src/popupwin.c b/src/popupwin.c index 7b7426178..dfe0cac62 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -407,7 +407,7 @@ get_pos_entry(dict_T *d, int give_error) return poppos_entries[nr].pp_val; if (give_error) - semsg(_(e_invarg2), str); + semsg(_(e_invalid_argument_str), str); return POPPOS_NONE; } @@ -468,7 +468,7 @@ apply_move_options(win_T *wp, dict_T *d) if (nr <= 0) nr = find_prop_type_id(str, NULL); if (nr <= 0) - semsg(_(e_invarg2), str); + semsg(_(e_invalid_argument_str), str); else wp->w_popup_prop_type = nr; } @@ -497,7 +497,7 @@ handle_moved_argument(win_T *wp, dictitem_T *di, int mousemoved) else if (STRCMP(s, "expr") == 0) flags = FIND_IDENT | FIND_STRING | FIND_EVAL; else if (STRCMP(s, "any") != 0) - semsg(_(e_invarg2), s); + semsg(_(e_invalid_argument_str), s); if (flags != 0) { if (mousemoved) @@ -546,7 +546,7 @@ handle_moved_argument(win_T *wp, dictitem_T *di, int mousemoved) } } else - semsg(_(e_invarg2), tv_get_string(&di->di_tv)); + semsg(_(e_invalid_argument_str), tv_get_string(&di->di_tv)); } static void @@ -559,7 +559,7 @@ check_highlight(dict_T *dict, char *name, char_u **pval) if (di != NULL) { if (di->di_tv.v_type != VAR_STRING) - semsg(_(e_invargval), name); + semsg(_(e_invalid_value_for_argument_str), name); else { str = tv_get_string(&di->di_tv); @@ -735,7 +735,7 @@ apply_general_options(win_T *wp, dict_T *dict) else ok = FALSE; if (!ok) - semsg(_(e_invargNval), "close", tv_get_string(&di->di_tv)); + semsg(_(e_invalid_value_for_argument_str_str), "close", tv_get_string(&di->di_tv)); } str = dict_get_string(dict, (char_u *)"highlight", FALSE); @@ -861,7 +861,7 @@ apply_general_options(win_T *wp, dict_T *dict) VIM_CLEAR(wp->w_popup_mask_cells); } else - semsg(_(e_invargval), "mask"); + semsg(_(e_invalid_value_for_argument_str), "mask"); } #if defined(FEAT_TIMERS) @@ -2645,7 +2645,7 @@ f_popup_settext(typval_T *argvars, typval_T *rettv UNUSED) if (wp != NULL) { if (argvars[1].v_type != VAR_STRING && argvars[1].v_type != VAR_LIST) - semsg(_(e_invarg2), tv_get_string(&argvars[1])); + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[1])); else { popup_set_buffer_text(wp->w_buffer, argvars[1]); diff --git a/src/quickfix.c b/src/quickfix.c index c007a9c95..05cae9e88 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -7653,7 +7653,7 @@ set_errorlist( // A dict argument cannot be specified with a non-empty list argument if (list->lv_len != 0 && what != NULL) { - semsg(_(e_invarg2), + semsg(_(e_invalid_argument_str), _("cannot have both a list and a \"what\" argument")); return FAIL; } @@ -7780,7 +7780,7 @@ cbuffer_process_args( if (buf == NULL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return FAIL; } diff --git a/src/screen.c b/src/screen.c index 320811bff..bc1a6c86c 100644 --- a/src/screen.c +++ b/src/screen.c @@ -4915,19 +4915,19 @@ set_chars_option(win_T *wp, char_u **varp) s = p + len + 1; c1 = get_encoded_char_adv(&s); if (char2cells(c1) > 1) - return e_invarg; + return e_invalid_argument; if (tab[i].cp == &lcs_chars.tab2) { if (*s == NUL) - return e_invarg; + return e_invalid_argument; c2 = get_encoded_char_adv(&s); if (char2cells(c2) > 1) - return e_invarg; + return e_invalid_argument; if (!(*s == ',' || *s == NUL)) { c3 = get_encoded_char_adv(&s); if (char2cells(c3) > 1) - return e_invarg; + return e_invalid_argument; } } @@ -4969,12 +4969,12 @@ set_chars_option(win_T *wp, char_u **varp) { c1 = get_encoded_char_adv(&s); if (char2cells(c1) > 1) - return e_invarg; + return e_invalid_argument; ++multispace_len; } if (multispace_len == 0) // lcs-multispace cannot be an empty string - return e_invarg; + return e_invalid_argument; p = s; } else @@ -4991,7 +4991,7 @@ set_chars_option(win_T *wp, char_u **varp) } } else - return e_invarg; + return e_invalid_argument; } if (*p == ',') diff --git a/src/scriptfile.c b/src/scriptfile.c index 7d0c27248..b9322587a 100644 --- a/src/scriptfile.c +++ b/src/scriptfile.c @@ -965,7 +965,7 @@ ExpandPackAddDir( cmd_source(char_u *fname, exarg_T *eap) { if (*fname == NUL) - emsg(_(e_argreq)); + emsg(_(e_argument_required)); else if (eap != NULL && eap->forceit) // ":source!": read Normal mode commands @@ -1441,7 +1441,7 @@ do_source( #endif if (got_int) - emsg(_(e_interr)); + emsg(_(e_interrupted)); ESTACK_CHECK_NOW estack_pop(); if (p_verbose > 1) @@ -1549,7 +1549,7 @@ ex_scriptnames(exarg_T *eap) { // :script {scriptId}: edit the script if (!SCRIPT_ID_VALID(eap->line2)) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else { eap->arg = SCRIPT_ITEM(eap->line2)->sn_name; @@ -1961,7 +1961,7 @@ ex_scriptversion(exarg_T *eap UNUSED) nr = getdigits(&eap->arg); if (nr == 0 || *eap->arg != NUL) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else if (nr > SCRIPT_VERSION_MAX) semsg(_("E999: scriptversion not supported: %d"), nr); else diff --git a/src/search.c b/src/search.c index 5851d5236..abe71a1ab 100644 --- a/src/search.c +++ b/src/search.c @@ -1120,7 +1120,7 @@ searchit( if (!found) // did not find it { if (got_int) - emsg(_(e_interr)); + emsg(_(e_interrupted)); else if ((options & SEARCH_MSG) == SEARCH_MSG) { if (p_ws) @@ -3990,7 +3990,7 @@ exit_matched: else if (!found && action != ACTION_EXPAND) { if (got_int || ins_compl_interrupted()) - emsg(_(e_interr)); + emsg(_(e_interrupted)); else if (type == FIND_DEFINE) emsg(_("E388: Couldn't find definition")); else @@ -4152,12 +4152,12 @@ f_searchcount(typval_T *argvars, typval_T *rettv) { if (di->di_tv.v_type != VAR_LIST) { - semsg(_(e_invarg2), "pos"); + semsg(_(e_invalid_argument_str), "pos"); return; } if (list_len(di->di_tv.vval.v_list) != 3) { - semsg(_(e_invarg2), "List format should be [lnum, col, off]"); + semsg(_(e_invalid_argument_str), "List format should be [lnum, col, off]"); return; } li = list_find(di->di_tv.vval.v_list, 0L); @@ -4813,7 +4813,7 @@ do_fuzzymatch(typval_T *argvars, typval_T *rettv, int retmatchpos) if (argvars[1].v_type != VAR_STRING || argvars[1].vval.v_string == NULL) { - semsg(_(e_invarg2), tv_get_string(&argvars[1])); + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[1])); return; } @@ -4837,7 +4837,7 @@ do_fuzzymatch(typval_T *argvars, typval_T *rettv, int retmatchpos) || di->di_tv.vval.v_string == NULL || *di->di_tv.vval.v_string == NUL) { - semsg(_(e_invarg2), tv_get_string(&di->di_tv)); + semsg(_(e_invalid_argument_str), tv_get_string(&di->di_tv)); return; } key = tv_get_string(&di->di_tv); @@ -4847,7 +4847,7 @@ do_fuzzymatch(typval_T *argvars, typval_T *rettv, int retmatchpos) cb = get_callback(&di->di_tv); if (cb.cb_name == NULL) { - semsg(_(e_invargval), "text_cb"); + semsg(_(e_invalid_value_for_argument_str), "text_cb"); return; } } diff --git a/src/sign.c b/src/sign.c index ba1ff0e40..1fef7692e 100644 --- a/src/sign.c +++ b/src/sign.c @@ -1379,7 +1379,7 @@ sign_define_cmd(char_u *sign_name, char_u *cmdline) } else { - semsg(_(e_invarg2), arg); + semsg(_(e_invalid_argument_str), arg); failed = TRUE; break; } @@ -1422,7 +1422,7 @@ sign_place_cmd( // :sign place group=* if (lnum >= 0 || sign_name != NULL || (group != NULL && *group == '\0')) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else sign_list_placed(buf, group); } @@ -1432,7 +1432,7 @@ sign_place_cmd( if (sign_name == NULL || buf == NULL || (group != NULL && *group == '\0')) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } @@ -1453,7 +1453,7 @@ sign_unplace_cmd( { if (lnum >= 0 || sign_name != NULL || (group != NULL && *group == '\0')) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } @@ -1522,7 +1522,7 @@ sign_jump_cmd( { if (sign_name == NULL && group == NULL && id == -1) { - emsg(_(e_argreq)); + emsg(_(e_argument_required)); return; } @@ -1531,7 +1531,7 @@ sign_jump_cmd( { // File or buffer is not specified or an empty group is used // or a line number or a sign name is specified. - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } (void)sign_jump(id, group, buf); @@ -1586,7 +1586,7 @@ parse_sign_cmd_args( { if (*signid != -1) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return FAIL; } *signid = -2; @@ -1635,7 +1635,7 @@ parse_sign_cmd_args( } else { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return FAIL; } arg = skipwhite(arg); @@ -2471,7 +2471,7 @@ f_sign_jump(typval_T *argvars, typval_T *rettv) return; if (sign_id <= 0) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } @@ -2537,7 +2537,7 @@ sign_place_from_dict( return -1; if (sign_id < 0) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return -1; } } @@ -2599,7 +2599,7 @@ sign_place_from_dict( lnum = tv_get_lnum(&di->di_tv); if (lnum <= 0) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); goto cleanup; } } @@ -2791,7 +2791,7 @@ sign_unplace_from_dict(typval_T *group_tv, dict_T *dict) sign_id = dict_get_number(dict, (char_u *)"id"); if (sign_id <= 0) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); goto cleanup; } } @@ -2866,7 +2866,7 @@ f_sign_unplace(typval_T *argvars, typval_T *rettv) if (argvars[0].v_type != VAR_STRING) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } diff --git a/src/spell.c b/src/spell.c index 857a79344..17b3ff8d5 100644 --- a/src/spell.c +++ b/src/spell.c @@ -4378,7 +4378,7 @@ did_set_spell_option(int is_spellfile) l = (int)STRLEN(curwin->w_s->b_p_spf); if (l > 0 && (l < 4 || STRCMP(curwin->w_s->b_p_spf + l - 4, ".add") != 0)) - errmsg = e_invarg; + errmsg = e_invalid_argument; } if (errmsg == NULL) @@ -4416,7 +4416,7 @@ compile_cap_prog(synblock_T *synblock) if (synblock->b_cap_prog == NULL) { synblock->b_cap_prog = rp; // restore the previous program - return e_invarg; + return e_invalid_argument; } } } diff --git a/src/spellfile.c b/src/spellfile.c index 03da272cd..dc6647a8b 100644 --- a/src/spellfile.c +++ b/src/spellfile.c @@ -5963,7 +5963,7 @@ mkspell( } if (incount <= 0) - emsg(_(e_invarg)); // need at least output and input names + emsg(_(e_invalid_argument)); // need at least output and input names else if (vim_strchr(gettail(wfname), '_') != NULL) emsg(_("E751: Output file name must not have region name")); else if (incount > MAXREGIONS) diff --git a/src/strings.c b/src/strings.c index 52cf12115..18b2cefb9 100644 --- a/src/strings.c +++ b/src/strings.c @@ -1061,7 +1061,7 @@ f_charidx(typval_T *argvars, typval_T *rettv) && argvars[2].v_type != VAR_NUMBER && argvars[2].v_type != VAR_BOOL)) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } @@ -1163,7 +1163,7 @@ f_str2nr(typval_T *argvars, typval_T *rettv) base = (int)tv_get_number(&argvars[1]); if (base != 2 && base != 8 && base != 10 && base != 16) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } if (argvars[2].v_type != VAR_UNKNOWN && tv_get_bool(&argvars[2])) @@ -1680,7 +1680,7 @@ f_tr(typval_T *argvars, typval_T *rettv) if (STRLEN(fromstr) != STRLEN(tostr)) { error: - semsg(_(e_invarg2), fromstr); + semsg(_(e_invalid_argument_str), fromstr); ga_clear(&ga); return; } @@ -1788,7 +1788,7 @@ f_trim(typval_T *argvars, typval_T *rettv) if (argvars[1].v_type != VAR_UNKNOWN && argvars[1].v_type != VAR_STRING) { - semsg(_(e_invarg2), tv_get_string(&argvars[1])); + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[1])); return; } @@ -1806,7 +1806,7 @@ f_trim(typval_T *argvars, typval_T *rettv) return; if (dir < 0 || dir > 2) { - semsg(_(e_invarg2), tv_get_string(&argvars[2])); + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[2])); return; } } diff --git a/src/syntax.c b/src/syntax.c index 3002bc90a..579c19486 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -4923,7 +4923,7 @@ error: if (rest != NULL) set_nextcmd(eap, rest); else - semsg(_(e_invarg2), arg); + semsg(_(e_invalid_argument_str), arg); redraw_curbuf_later(SOME_VALID); syn_stack_free_all(curwin->w_s); // Need to recompute all syntax. @@ -5032,7 +5032,7 @@ syn_cmd_match( vim_free(syn_opt_arg.next_list); if (rest == NULL && called_emsg == orig_called_emsg) - semsg(_(e_invarg2), arg); + semsg(_(e_invalid_argument_str), arg); } /* @@ -5298,7 +5298,7 @@ syn_cmd_region( if (not_enough) semsg(_("E399: Not enough arguments: syntax region %s"), arg); else if (illegal || rest == NULL) - semsg(_(e_invarg2), arg); + semsg(_(e_invalid_argument_str), arg); } } @@ -5607,7 +5607,7 @@ syn_cmd_cluster(exarg_T *eap, int syncing UNUSED) clstr_list = NULL; if (get_id_list(&rest, opt_len, &clstr_list, eap->skip) == FAIL) { - semsg(_(e_invarg2), rest); + semsg(_(e_invalid_argument_str), rest); break; } if (scl_id >= 0) @@ -5628,7 +5628,7 @@ syn_cmd_cluster(exarg_T *eap, int syncing UNUSED) if (!got_clstr) emsg(_("E400: No cluster specified")); if (rest == NULL || !ends_excmd2(eap->cmd, rest)) - semsg(_(e_invarg2), arg); + semsg(_(e_invalid_argument_str), arg); } /* @@ -6632,7 +6632,7 @@ ex_syntime(exarg_T *eap) else if (STRCMP(eap->arg, "report") == 0) syntime_report(); else - semsg(_(e_invarg2), eap->arg); + semsg(_(e_invalid_argument_str), eap->arg); } static void diff --git a/src/terminal.c b/src/terminal.c index a88e4bc0f..46307ea3a 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -459,7 +459,7 @@ term_start( && argvar->vval.v_list != NULL && argvar->vval.v_list->lv_first == &range_list_item)) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return NULL; } @@ -872,7 +872,7 @@ ex_terminal(exarg_T *eap) tty_type = 'c'; else { - semsg(e_invargval, "type"); + semsg(e_invalid_value_for_argument_str, "type"); goto theend; } opt.jo_set2 |= JO2_TTY_TYPE; @@ -4241,7 +4241,7 @@ init_vterm_ansi_colors(VTerm *vterm) || var->di_tv.vval.v_list == NULL || var->di_tv.vval.v_list->lv_first == &range_list_item || set_ansi_colors_list(vterm, var->di_tv.vval.v_list) == FAIL)) - semsg(_(e_invarg2), "g:terminal_ansi_colors"); + semsg(_(e_invalid_argument_str), "g:terminal_ansi_colors"); } #endif @@ -5368,7 +5368,7 @@ term_load_dump(typval_T *argvars, typval_T *rettv, int do_diff) fname2 = tv_get_string_buf_chk(&argvars[1], buf2); if (fname1 == NULL || (do_diff && fname2 == NULL)) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } fd1 = mch_fopen((char *)fname1, READBIN); @@ -5414,7 +5414,7 @@ term_load_dump(typval_T *argvars, typval_T *rettv, int do_diff) // With "bufnr" argument: enter the window with this buffer and make it // empty. if (wp == NULL) - semsg(_(e_invarg2), "bufnr"); + semsg(_(e_invalid_argument_str), "bufnr"); else { buf = curbuf; @@ -6093,7 +6093,7 @@ f_term_gettty(typval_T *argvars, typval_T *rettv) p = buf->b_term->tl_job->jv_tty_in; break; default: - semsg(_(e_invarg2), tv_get_string(&argvars[1])); + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[1])); return; } if (p != NULL) @@ -6351,7 +6351,7 @@ f_term_setansicolors(typval_T *argvars, typval_T *rettv UNUSED) } if (set_ansi_colors_list(term->tl_vterm, argvars[1].vval.v_list) == FAIL) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); } #endif @@ -6689,7 +6689,7 @@ conpty_term_and_job_init( } if (cmd == NULL || *cmd == NUL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); goto failed; } @@ -7037,7 +7037,7 @@ winpty_term_and_job_init( } if (cmd == NULL || *cmd == NUL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); goto failed; } diff --git a/src/testing.c b/src/testing.c index 1037c44a8..782d35c5a 100644 --- a/src/testing.c +++ b/src/testing.c @@ -907,12 +907,12 @@ f_test_alloc_fail(typval_T *argvars, typval_T *rettv UNUSED) || argvars[1].v_type != VAR_NUMBER || argvars[1].vval.v_number < 0 || argvars[2].v_type != VAR_NUMBER) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else { alloc_fail_id = argvars[0].vval.v_number; if (alloc_fail_id >= aid_last) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); alloc_fail_countdown = argvars[1].vval.v_number; alloc_fail_repeat = argvars[2].vval.v_number; did_outofmem_msg = FALSE; @@ -967,7 +967,7 @@ f_test_getvalue(typval_T *argvars, typval_T *rettv) return; if (argvars[0].v_type != VAR_STRING) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else { char_u *name = tv_get_string(&argvars[0]); @@ -975,7 +975,7 @@ f_test_getvalue(typval_T *argvars, typval_T *rettv) if (STRCMP(name, (char_u *)"need_fileinfo") == 0) rettv->vval.v_number = need_fileinfo; else - semsg(_(e_invarg2), name); + semsg(_(e_invalid_argument_str), name); } } @@ -991,12 +991,12 @@ f_test_option_not_set(typval_T *argvars, typval_T *rettv UNUSED) return; if (argvars[0].v_type != VAR_STRING) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else { name = tv_get_string(&argvars[0]); if (reset_option_was_set(name) == FAIL) - semsg(_(e_invarg2), name); + semsg(_(e_invalid_argument_str), name); } } @@ -1017,7 +1017,7 @@ f_test_override(typval_T *argvars, typval_T *rettv UNUSED) if (argvars[0].v_type != VAR_STRING || (argvars[1].v_type) != VAR_NUMBER) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else { name = tv_get_string(&argvars[0]); @@ -1072,7 +1072,7 @@ f_test_override(typval_T *argvars, typval_T *rettv UNUSED) } } else - semsg(_(e_invarg2), name); + semsg(_(e_invalid_argument_str), name); } } @@ -1171,7 +1171,7 @@ f_test_ignore_error(typval_T *argvars, typval_T *rettv UNUSED) return; if (argvars[0].v_type != VAR_STRING) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else ignore_error_for_testing(tv_get_string(&argvars[0])); } @@ -1264,7 +1264,7 @@ f_test_scrollbar(typval_T *argvars, typval_T *rettv UNUSED) || (argvars[1].v_type) != VAR_NUMBER || (argvars[2].v_type) != VAR_NUMBER) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } which = tv_get_string(&argvars[0]); @@ -1279,7 +1279,7 @@ f_test_scrollbar(typval_T *argvars, typval_T *rettv UNUSED) sb = &gui.bottom_sbar; if (sb == NULL) { - semsg(_(e_invarg2), which); + semsg(_(e_invalid_argument_str), which); return; } gui_drag_scrollbar(sb, value, dragging); @@ -1300,7 +1300,7 @@ f_test_setmouse(typval_T *argvars, typval_T *rettv UNUSED) if (argvars[0].v_type != VAR_NUMBER || (argvars[1].v_type) != VAR_NUMBER) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } diff --git a/src/textprop.c b/src/textprop.c index b3dac1f7e..3159920ee 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -362,7 +362,7 @@ f_prop_add_list(typval_T *argvars, typval_T *rettv UNUSED) if (error || start_lnum <= 0 || start_col <= 0 || end_lnum <= 0 || end_col <= 0) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } if (prop_add_one(buf, type_name, id, start_lnum, end_lnum, @@ -405,7 +405,7 @@ prop_add_common( end_lnum = dict_get_number(dict, (char_u *)"end_lnum"); if (end_lnum < start_lnum) { - semsg(_(e_invargval), "end_lnum"); + semsg(_(e_invalid_value_for_argument_str), "end_lnum"); return; } } @@ -418,7 +418,7 @@ prop_add_common( if (length < 0 || end_lnum > start_lnum) { - semsg(_(e_invargval), "length"); + semsg(_(e_invalid_value_for_argument_str), "length"); return; } end_col = start_col + length; @@ -428,7 +428,7 @@ prop_add_common( end_col = dict_get_number(dict, (char_u *)"end_col"); if (end_col <= 0) { - semsg(_(e_invargval), "end_col"); + semsg(_(e_invalid_value_for_argument_str), "end_col"); return; } } @@ -750,7 +750,7 @@ f_prop_find(typval_T *argvars, typval_T *rettv) dir = -1; else if (*dir_s != 'f') { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } } @@ -1179,7 +1179,7 @@ f_prop_remove(typval_T *argvars, typval_T *rettv) if (argvars[0].v_type != VAR_DICT || argvars[0].vval.v_dict == NULL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } @@ -1316,7 +1316,7 @@ prop_type_set(typval_T *argvars, int add) name = tv_get_string(&argvars[0]); if (*name == NUL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } @@ -1451,7 +1451,7 @@ f_prop_type_delete(typval_T *argvars, typval_T *rettv UNUSED) name = tv_get_string(&argvars[0]); if (*name == NUL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } @@ -1492,7 +1492,7 @@ f_prop_type_get(typval_T *argvars, typval_T *rettv) name = tv_get_string(&argvars[0]); if (*name == NUL) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } if (rettv_dict_alloc(rettv) == OK) diff --git a/src/time.c b/src/time.c index bb4a20282..001f2d812 100644 --- a/src/time.c +++ b/src/time.c @@ -190,7 +190,7 @@ f_reltime(typval_T *argvars UNUSED, typval_T *rettv UNUSED) if (list2proftime(&argvars[0], &res) == FAIL) { if (in_vim9script()) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } profile_end(&res); @@ -202,7 +202,7 @@ f_reltime(typval_T *argvars UNUSED, typval_T *rettv UNUSED) || list2proftime(&argvars[1], &res) == FAIL) { if (in_vim9script()) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return; } profile_sub(&res, &start); @@ -240,7 +240,7 @@ f_reltimefloat(typval_T *argvars UNUSED, typval_T *rettv) if (list2proftime(&argvars[0], &tm) == OK) rettv->vval.v_float = profile_float(&tm); else if (in_vim9script()) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); # endif } # endif @@ -264,7 +264,7 @@ f_reltimestr(typval_T *argvars UNUSED, typval_T *rettv) if (list2proftime(&argvars[0], &tm) == OK) rettv->vval.v_string = vim_strsave((char_u *)profile_msg(&tm)); else if (in_vim9script()) - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); # endif } @@ -842,7 +842,7 @@ f_timer_start(typval_T *argvars, typval_T *rettv) if (argvars[2].v_type != VAR_DICT || (dict = argvars[2].vval.v_dict) == NULL) { - semsg(_(e_invarg2), tv_get_string(&argvars[2])); + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[2])); return; } if (dict_find(dict, (char_u *)"repeat", -1) != NULL) diff --git a/src/userfunc.c b/src/userfunc.c index c3b000eab..65970e1d1 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -254,7 +254,7 @@ get_function_args( if (mustend && *p != endchar) { if (!skip) - semsg(_(e_invarg2), *argp); + semsg(_(e_invalid_argument_str), *argp); goto err_ret; } if (*p == endchar) @@ -3692,7 +3692,7 @@ trans_function_name( if (!aborting()) { if (end != NULL) - semsg(_(e_invarg2), start); + semsg(_(e_invalid_argument_str), start); } else *pp = find_name_end(start, NULL, NULL, FNE_INCL_BR); @@ -4258,7 +4258,7 @@ define_function(exarg_T *eap, char_u *name_arg, char_u **line_to_free) : eval_isnamec(name_base[i])); ++i) ; if (name_base[i] != NUL) - emsg_funcname((char *)e_invarg2, arg); + emsg_funcname((char *)e_invalid_argument_str, arg); // In Vim9 script a function cannot have the same name as a // variable. @@ -4909,7 +4909,7 @@ ex_delfunction(exarg_T *eap) if (numbered_function(name) && fudi.fd_dict == NULL) { if (!eap->skip) - semsg(_(e_invarg2), eap->arg); + semsg(_(e_invalid_argument_str), eap->arg); vim_free(name); return; } diff --git a/src/version.c b/src/version.c index aaa76035f..945d147a5 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3961, +/**/ 3960, /**/ 3959, diff --git a/src/vim9cmds.c b/src/vim9cmds.c index eb28a7922..ad54659d8 100644 --- a/src/vim9cmds.c +++ b/src/vim9cmds.c @@ -1016,7 +1016,7 @@ compile_endfor(char_u *arg, cctx_T *cctx) if (scope == NULL || scope->se_type != FOR_SCOPE) { - emsg(_(e_for)); + emsg(_(e_endfor_without_for)); return NULL; } forscope = &scope->se_u.se_for; @@ -1109,7 +1109,7 @@ compile_endwhile(char_u *arg, cctx_T *cctx) return NULL; if (scope == NULL || scope->se_type != WHILE_SCOPE) { - emsg(_(e_while)); + emsg(_(e_endwhile_without_while)); return NULL; } cctx->ctx_scope = scope->se_outer; @@ -1328,7 +1328,7 @@ compile_catch(char_u *arg, cctx_T *cctx UNUSED) // Error if not in a :try scope if (scope == NULL || scope->se_type != TRY_SCOPE) { - emsg(_(e_catch)); + emsg(_(e_catch_without_try)); return NULL; } @@ -1447,7 +1447,7 @@ compile_finally(char_u *arg, cctx_T *cctx) // Error if not in a :try scope if (scope == NULL || scope->se_type != TRY_SCOPE) { - emsg(_(e_finally)); + emsg(_(e_finally_without_try)); return NULL; } @@ -1457,7 +1457,7 @@ compile_finally(char_u *arg, cctx_T *cctx) isn = ((isn_T *)instr->ga_data) + scope->se_u.se_try.ts_try_label; if (isn->isn_arg.tryref.try_ref->try_finally != 0) { - emsg(_(e_finally_dup)); + emsg(_(e_multiple_finally)); return NULL; } @@ -1518,7 +1518,7 @@ compile_endtry(char_u *arg, cctx_T *cctx) if (scope == NULL || scope->se_type != TRY_SCOPE) { if (scope == NULL) - emsg(_(e_no_endtry)); + emsg(_(e_endtry_without_try)); else if (scope->se_type == WHILE_SCOPE) emsg(_(e_missing_endwhile)); else if (scope->se_type == FOR_SCOPE) diff --git a/src/vim9execute.c b/src/vim9execute.c index fd5363080..b92f5b925 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -6022,7 +6022,7 @@ ex_disassemble(exarg_T *eap) TFN_INT | TFN_QUIET | TFN_NO_AUTOLOAD, NULL, NULL, NULL); if (fname == NULL) { - semsg(_(e_invarg2), eap->arg); + semsg(_(e_invalid_argument_str), eap->arg); return; } diff --git a/src/vim9script.c b/src/vim9script.c index 72c70883d..ad0830fa2 100644 --- a/src/vim9script.c +++ b/src/vim9script.c @@ -83,7 +83,7 @@ ex_vim9script(exarg_T *eap UNUSED) } if (!IS_WHITE_OR_NUL(*eap->arg) && STRCMP(eap->arg, "noclear") != 0) { - semsg(_(e_invarg2), eap->arg); + semsg(_(e_invalid_argument_str), eap->arg); return; } if (si->sn_state == SN_STATE_RELOAD && IS_WHITE_OR_NUL(*eap->arg)) @@ -771,7 +771,7 @@ vim9_declare_scriptvar(exarg_T *eap, char_u *arg) // Check for valid starting character. if (!eval_isnamec1(*arg)) { - semsg(_(e_invarg2), arg); + semsg(_(e_invalid_argument_str), arg); return arg + STRLEN(arg); } diff --git a/src/window.c b/src/window.c index ca35e5bc8..51055b4bc 100644 --- a/src/window.c +++ b/src/window.c @@ -6990,7 +6990,7 @@ check_colorcolumn(win_T *wp) col = (*s == '-') ? -1 : 1; ++s; if (!VIM_ISDIGIT(*s)) - return e_invarg; + return e_invalid_argument; col = col * getdigits(&s); if (wp->w_buffer->b_p_tw == 0) goto skip; // 'textwidth' not set, skip this item @@ -7001,15 +7001,15 @@ check_colorcolumn(win_T *wp) else if (VIM_ISDIGIT(*s)) col = getdigits(&s); else - return e_invarg; + return e_invalid_argument; color_cols[count++] = col - 1; // 1-based to 0-based skip: if (*s == NUL) break; if (*s != ',') - return e_invarg; + return e_invalid_argument; if (*++s == NUL) - return e_invarg; // illegal trailing comma as in "set cc=80," + return e_invalid_argument; // illegal trailing comma as in "set cc=80," } vim_free(wp->w_p_cc_cols); |