diff options
62 files changed, 427 insertions, 403 deletions
diff --git a/src/arglist.c b/src/arglist.c index d159f3f7cc..104c67a00f 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 94bd49aa68..4831ea80dc 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 9d41bdc271..37d2be69b6 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 45e962848f..c0d5de36ce 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 05e248933b..5133440173 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 38596f589c..09d05c9eed 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 73c5a91664..9468beba75 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 57a94a180a..54bf6ba872 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 b49005ab4f..6773c757d9 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 ccd8dbde42..e5f004e9ff 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 40a5910461..0c5967b6c3 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 b9310c1933..9b49d81e8f 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 03ed5c1034..381bda4954 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 4ac60265cc..f86302684b 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) |