0
0
mirror of https://github.com/vim/vim.git synced 2025-08-31 20:53:42 -04:00

patch 8.2.3069: error messages are spread out

Problem:    Error messages are spread out.
Solution:   Move some error messages to errors.h.  Use clearer names.
This commit is contained in:
Bram Moolenaar 2021-06-27 22:03:33 +02:00
parent d887297ad0
commit 108010aa47
32 changed files with 130 additions and 109 deletions

View File

@ -832,7 +832,7 @@ ex_argdelete(exarg_T *eap)
{ {
// Don't give an error for ":%argdel" if the list is empty. // Don't give an error for ":%argdel" if the list is empty.
if (eap->line1 != 1 || eap->line2 != 0) if (eap->line1 != 1 || eap->line2 != 0)
emsg(_(e_invrange)); emsg(_(e_invalid_range));
} }
else else
{ {
@ -920,7 +920,7 @@ do_arg_all(
#ifdef FEAT_CMDWIN #ifdef FEAT_CMDWIN
if (cmdwin_type != 0) if (cmdwin_type != 0)
{ {
emsg(_(e_cmdwin)); emsg(_(e_invalid_in_cmdline_window));
return; return;
} }
#endif #endif

View File

@ -2407,7 +2407,7 @@ buflist_getfile(
if (buf == NULL) if (buf == NULL)
{ {
if ((options & GETF_ALT) && n == 0) if ((options & GETF_ALT) && n == 0)
emsg(_(e_noalt)); emsg(_(e_no_alternate_file));
else else
semsg(_("E92: Buffer %d not found"), n); semsg(_("E92: Buffer %d not found"), n);
return FAIL; return FAIL;
@ -3516,7 +3516,7 @@ getaltfname(
if (buflist_name_nr(0, &fname, &dummy) == FAIL) if (buflist_name_nr(0, &fname, &dummy) == FAIL)
{ {
if (errmsg) if (errmsg)
emsg(_(e_noalt)); emsg(_(e_no_alternate_file));
return NULL; return NULL;
} }
return fname; return fname;

View File

@ -1232,7 +1232,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt)
if (!buf->b_p_ma && !channel->ch_part[PART_OUT].ch_nomodifiable) if (!buf->b_p_ma && !channel->ch_part[PART_OUT].ch_nomodifiable)
{ {
emsg(_(e_modifiable)); emsg(_(e_cannot_make_changes_modifiable_is_off));
} }
else else
{ {
@ -1278,7 +1278,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt)
!opt->jo_modifiable[PART_ERR]; !opt->jo_modifiable[PART_ERR];
if (!buf->b_p_ma && !channel->ch_part[PART_ERR].ch_nomodifiable) if (!buf->b_p_ma && !channel->ch_part[PART_ERR].ch_nomodifiable)
{ {
emsg(_(e_modifiable)); emsg(_(e_cannot_make_changes_modifiable_is_off));
} }
else else
{ {

View File

@ -10,6 +10,44 @@
* Definition of error messages, sorted on error number. * Definition of error messages, sorted on error number.
*/ */
EXTERN char e_backslash_should_be_followed_by[]
INIT(= N_("E10: \\ should be followed by /, ? or &"));
#ifdef FEAT_CMDWIN
EXTERN char e_invalid_in_cmdline_window[]
INIT(= N_("E11: Invalid in command-line window; <CR> executes, CTRL-C quits"));
#endif
EXTERN char e_command_not_allowed_from_vimrc_in_current_dir_or_tag_search[]
INIT(= N_("E12: Command not allowed from exrc/vimrc in current dir or tag search"));
EXTERN char e_file_exists[]
INIT(= N_("E13: File exists (add ! to override)"));
#ifdef FEAT_EVAL
EXTERN char e_invalid_expression_str[]
INIT(= N_("E15: Invalid expression: \"%s\""));
#endif
EXTERN char e_invalid_range[]
INIT(= N_("E16: Invalid range"));
#if defined(UNIX) || defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
EXTERN char e_src_is_directory[]
INIT(= N_("E17: \"%s\" is a directory"));
#endif
#ifdef FEAT_EVAL
EXTERN char e_unexpected_characters_in_let[]
INIT(= N_("E18: Unexpected characters in :let"));
EXTERN char e_unexpected_characters_in_assignment[]
INIT(= N_("E18: Unexpected characters in assignment"));
#endif
EXTERN char e_mark_has_invalid_line_number[]
INIT(= N_("E19: Mark has invalid line number"));
EXTERN char e_mark_not_set[]
INIT(= N_("E20: Mark not set"));
EXTERN char e_cannot_make_changes_modifiable_is_off[]
INIT(= N_("E21: Cannot make changes, 'modifiable' is off"));
EXTERN char e_scripts_nested_too_deep[]
INIT(= N_("E22: Scripts nested too deep"));
EXTERN char e_no_alternate_file[]
INIT(= N_("E23: No alternate file"));
EXTERN char e_no_such_abbreviation[]
INIT(= N_("E24: No such abbreviation"));
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
EXTERN char e_undefined_variable_str[] EXTERN char e_undefined_variable_str[]
INIT(= N_("E121: Undefined variable: %s")); INIT(= N_("E121: Undefined variable: %s"));

View File

@ -216,7 +216,7 @@ eval1_emsg(char_u **arg, typval_T *rettv, exarg_T *eap)
// Also check called_emsg for when using assert_fails(). // Also check called_emsg for when using assert_fails().
if (!aborting() && did_emsg == did_emsg_before if (!aborting() && did_emsg == did_emsg_before
&& called_emsg == called_emsg_before) && called_emsg == called_emsg_before)
semsg(_(e_invexpr2), start); semsg(_(e_invalid_expression_str), start);
} }
clear_evalarg(&evalarg, eap); clear_evalarg(&evalarg, eap);
return ret; return ret;
@ -297,7 +297,7 @@ eval_expr_typval(typval_T *expr, typval_T *argv, int argc, typval_T *rettv)
if (*skipwhite(s) != NUL) // check for trailing chars after expr if (*skipwhite(s) != NUL) // check for trailing chars after expr
{ {
clear_tv(rettv); clear_tv(rettv);
semsg(_(e_invexpr2), s); semsg(_(e_invalid_expression_str), s);
return FAIL; return FAIL;
} }
} }
@ -2268,7 +2268,7 @@ eval0(
if (end_error) if (end_error)
semsg(_(e_trailing_arg), p); semsg(_(e_trailing_arg), p);
else else
semsg(_(e_invexpr2), arg); semsg(_(e_invalid_expression_str), arg);
} }
// Some of the expression may not have been consumed. Do not check for // Some of the expression may not have been consumed. Do not check for
@ -2758,7 +2758,7 @@ eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
if (vim9script && type_is && (p[len] == '?' || p[len] == '#')) if (vim9script && type_is && (p[len] == '?' || p[len] == '#'))
{ {
semsg(_(e_invexpr2), p); semsg(_(e_invalid_expression_str), p);
clear_tv(rettv); clear_tv(rettv);
return FAIL; return FAIL;
} }
@ -3367,7 +3367,7 @@ eval_leader(char_u **arg, int vim9)
// ++, --, -+ and +- are not accepted in Vim9 script // ++, --, -+ and +- are not accepted in Vim9 script
if (vim9 && (*p == '-' || *p == '+') && (*n == '-' || *n == '+')) if (vim9 && (*p == '-' || *p == '+') && (*n == '-' || *n == '+'))
{ {
semsg(_(e_invexpr2), s); semsg(_(e_invalid_expression_str), s);
return FAIL; return FAIL;
} }
p = n; p = n;
@ -3441,7 +3441,7 @@ eval7(
#endif #endif
)) ))
{ {
semsg(_(e_invexpr2), *arg); semsg(_(e_invalid_expression_str), *arg);
++*arg; ++*arg;
return FAIL; return FAIL;
} }
@ -5607,7 +5607,7 @@ get_name_len(
// Only give an error when there is something, otherwise it will be // Only give an error when there is something, otherwise it will be
// reported at a higher level. // reported at a higher level.
if (len == 0 && verbose && **arg != NUL) if (len == 0 && verbose && **arg != NUL)
semsg(_(e_invexpr2), *arg); semsg(_(e_invalid_expression_str), *arg);
return len; return len;
} }
@ -6153,7 +6153,7 @@ ex_echo(exarg_T *eap)
*/ */
if (!aborting() && did_emsg == did_emsg_before if (!aborting() && did_emsg == did_emsg_before
&& called_emsg == called_emsg_before) && called_emsg == called_emsg_before)
semsg(_(e_invexpr2), arg_start); semsg(_(e_invalid_expression_str), arg_start);
need_clr_eos = FALSE; need_clr_eos = FALSE;
break; break;
} }

View File

@ -2923,7 +2923,7 @@ f_eval(typval_T *argvars, typval_T *rettv)
if (s == NULL || eval1(&s, rettv, &EVALARG_EVALUATE) == FAIL) if (s == NULL || eval1(&s, rettv, &EVALARG_EVALUATE) == FAIL)
{ {
if (p != NULL && !aborting()) if (p != NULL && !aborting())
semsg(_(e_invexpr2), p); semsg(_(e_invalid_expression_str), p);
need_clr_eos = FALSE; need_clr_eos = FALSE;
rettv->v_type = VAR_NUMBER; rettv->v_type = VAR_NUMBER;
rettv->vval.v_number = 0; rettv->vval.v_number = 0;

View File

@ -1334,7 +1334,7 @@ ex_let_one(
semsg(_(e_letwrong), op); semsg(_(e_letwrong), op);
else if (endchars != NULL else if (endchars != NULL
&& vim_strchr(endchars, *skipwhite(arg)) == NULL) && vim_strchr(endchars, *skipwhite(arg)) == NULL)
emsg(_(e_letunexp)); emsg(_(e_unexpected_characters_in_let));
else if (!check_secure()) else if (!check_secure())
{ {
c1 = name[len]; c1 = name[len];
@ -1379,7 +1379,7 @@ ex_let_one(
p = find_option_end(&arg, &opt_flags); p = find_option_end(&arg, &opt_flags);
if (p == NULL || (endchars != NULL if (p == NULL || (endchars != NULL
&& vim_strchr(endchars, *skipwhite(p)) == NULL)) && vim_strchr(endchars, *skipwhite(p)) == NULL))
emsg(_(e_letunexp)); emsg(_(e_unexpected_characters_in_let));
else else
{ {
long n = 0; long n = 0;
@ -1481,7 +1481,7 @@ ex_let_one(
semsg(_(e_letwrong), op); semsg(_(e_letwrong), op);
else if (endchars != NULL else if (endchars != NULL
&& vim_strchr(endchars, *skipwhite(arg + 1)) == NULL) && vim_strchr(endchars, *skipwhite(arg + 1)) == NULL)
emsg(_(e_letunexp)); emsg(_(e_unexpected_characters_in_let));
else else
{ {
char_u *ptofree = NULL; char_u *ptofree = NULL;
@ -1520,7 +1520,7 @@ ex_let_one(
{ {
if (endchars != NULL && vim_strchr(endchars, if (endchars != NULL && vim_strchr(endchars,
*skipwhite(lv.ll_name_end)) == NULL) *skipwhite(lv.ll_name_end)) == NULL)
emsg(_(e_letunexp)); emsg(_(e_unexpected_characters_in_let));
else else
{ {
set_var_lval(&lv, p, tv, copy, flags, op, var_idx); set_var_lval(&lv, p, tv, copy, flags, op, var_idx);

View File

@ -363,7 +363,7 @@ get_winnr(tabpage_T *tp, typval_T *argvar)
if (invalid_arg) if (invalid_arg)
{ {
semsg(_(e_invexpr2), arg); semsg(_(e_invalid_expression_str), arg);
nr = 0; nr = 0;
} }
} }
@ -636,7 +636,7 @@ f_tabpagenr(typval_T *argvars UNUSED, typval_T *rettv)
nr = valid_tabpage(lastused_tabpage) ? nr = valid_tabpage(lastused_tabpage) ?
tabpage_index(lastused_tabpage) : 0; tabpage_index(lastused_tabpage) : 0;
else else
semsg(_(e_invexpr2), arg); semsg(_(e_invalid_expression_str), arg);
} }
} }
else else
@ -726,7 +726,7 @@ f_win_gotoid(typval_T *argvars, typval_T *rettv)
#ifdef FEAT_CMDWIN #ifdef FEAT_CMDWIN
if (cmdwin_type != 0) if (cmdwin_type != 0)
{ {
emsg(_(e_cmdwin)); emsg(_(e_invalid_in_cmdline_window));
return; return;
} }
#endif #endif

View File

@ -2120,7 +2120,7 @@ check_overwrite(
// with UNIX it is possible to open a directory // with UNIX it is possible to open a directory
if (mch_isdir(ffname)) if (mch_isdir(ffname))
{ {
semsg(_(e_isadir2), ffname); semsg(_(e_src_is_directory), ffname);
return FAIL; return FAIL;
} }
#endif #endif
@ -2137,7 +2137,7 @@ check_overwrite(
else else
#endif #endif
{ {
emsg(_(e_exists)); emsg(_(e_file_exists));
return FAIL; return FAIL;
} }
} }
@ -3586,7 +3586,7 @@ check_secure(void)
if (secure) if (secure)
{ {
secure = 2; secure = 2;
emsg(_(e_curdir)); emsg(_(e_command_not_allowed_from_vimrc_in_current_dir_or_tag_search));
return TRUE; return TRUE;
} }
#ifdef HAVE_SANDBOX #ifdef HAVE_SANDBOX
@ -3729,7 +3729,7 @@ ex_substitute(exarg_T *eap)
++cmd; ++cmd;
if (vim_strchr((char_u *)"/?&", *cmd) == NULL) if (vim_strchr((char_u *)"/?&", *cmd) == NULL)
{ {
emsg(_(e_backslash)); emsg(_(e_backslash_should_be_followed_by));
return; return;
} }
if (*cmd != '&') if (*cmd != '&')
@ -3944,7 +3944,7 @@ ex_substitute(exarg_T *eap)
if (!subflags.do_count && !curbuf->b_p_ma) if (!subflags.do_count && !curbuf->b_p_ma)
{ {
// Substitution is not allowed in non-'modifiable' buffer // Substitution is not allowed in non-'modifiable' buffer
emsg(_(e_modifiable)); emsg(_(e_cannot_make_changes_modifiable_is_off));
return; return;
} }
@ -4903,7 +4903,7 @@ ex_global(exarg_T *eap)
++cmd; ++cmd;
if (vim_strchr((char_u *)"/?&", *cmd) == NULL) if (vim_strchr((char_u *)"/?&", *cmd) == NULL)
{ {
emsg(_(e_backslash)); emsg(_(e_backslash_should_be_followed_by));
return; return;
} }
if (*cmd == '&') if (*cmd == '&')

View File

@ -1997,7 +1997,7 @@ do_one_cmd(
} }
if (ea.line2 < 0) if (ea.line2 < 0)
errormsg = _(e_invrange); errormsg = _(e_invalid_range);
else else
{ {
if (ea.line2 == 0) if (ea.line2 == 0)
@ -2124,7 +2124,7 @@ do_one_cmd(
if (!curbuf->b_p_ma && (ea.argt & EX_MODIFY)) if (!curbuf->b_p_ma && (ea.argt & EX_MODIFY))
{ {
// Command not allowed in non-'modifiable' buffer // Command not allowed in non-'modifiable' buffer
errormsg = _(e_modifiable); errormsg = _(e_cannot_make_changes_modifiable_is_off);
goto doend; goto doend;
} }
@ -2134,7 +2134,7 @@ do_one_cmd(
if (cmdwin_type != 0 && !(ea.argt & EX_CMDWIN)) if (cmdwin_type != 0 && !(ea.argt & EX_CMDWIN))
{ {
// Command not allowed in the command line window // Command not allowed in the command line window
errormsg = _(e_cmdwin); errormsg = _(e_invalid_in_cmdline_window);
goto doend; goto doend;
} }
#endif #endif
@ -2996,7 +2996,7 @@ parse_command_modifiers(
{ {
if (tabnr < 0 || tabnr > LAST_TAB_NR) if (tabnr < 0 || tabnr > LAST_TAB_NR)
{ {
*errormsg = _(e_invrange); *errormsg = _(e_invalid_range);
return FAIL; return FAIL;
} }
cmod->cmod_tab = tabnr + 1; cmod->cmod_tab = tabnr + 1;
@ -3239,14 +3239,14 @@ parse_cmd_address(exarg_T *eap, char **errormsg, int silent)
{ {
// there is no Vim command which uses '%' and // there is no Vim command which uses '%' and
// ADDR_WINDOWS or ADDR_TABS // ADDR_WINDOWS or ADDR_TABS
*errormsg = _(e_invrange); *errormsg = _(e_invalid_range);
return FAIL; return FAIL;
} }
break; break;
case ADDR_TABS_RELATIVE: case ADDR_TABS_RELATIVE:
case ADDR_UNSIGNED: case ADDR_UNSIGNED:
case ADDR_QUICKFIX: case ADDR_QUICKFIX:
*errormsg = _(e_invrange); *errormsg = _(e_invalid_range);
return FAIL; return FAIL;
case ADDR_ARGUMENTS: case ADDR_ARGUMENTS:
if (ARGCOUNT == 0) if (ARGCOUNT == 0)
@ -3278,7 +3278,7 @@ parse_cmd_address(exarg_T *eap, char **errormsg, int silent)
// '*' - visual area // '*' - visual area
if (eap->addr_type != ADDR_LINES) if (eap->addr_type != ADDR_LINES)
{ {
*errormsg = _(e_invrange); *errormsg = _(e_invalid_range);
return FAIL; return FAIL;
} }
@ -3923,7 +3923,7 @@ addr_error(cmd_addr_T addr_type)
if (addr_type == ADDR_NONE) if (addr_type == ADDR_NONE)
emsg(_(e_norange)); emsg(_(e_norange));
else else
emsg(_(e_invrange)); emsg(_(e_invalid_range));
} }
/* /*
@ -4210,7 +4210,7 @@ get_address(
i = RE_SEARCH; i = RE_SEARCH;
else else
{ {
emsg(_(e_backslash)); emsg(_(e_backslash_should_be_followed_by));
cmd = NULL; cmd = NULL;
goto error; goto error;
} }
@ -4312,7 +4312,7 @@ get_address(
if (addr_type == ADDR_TABS_RELATIVE) if (addr_type == ADDR_TABS_RELATIVE)
{ {
emsg(_(e_invrange)); emsg(_(e_invalid_range));
cmd = NULL; cmd = NULL;
goto error; goto error;
} }
@ -4460,7 +4460,7 @@ invalid_range(exarg_T *eap)
if ( eap->line1 < 0 if ( eap->line1 < 0
|| eap->line2 < 0 || eap->line2 < 0
|| eap->line1 > eap->line2) || eap->line1 > eap->line2)
return _(e_invrange); return _(e_invalid_range);
if (eap->argt & EX_RANGE) if (eap->argt & EX_RANGE)
{ {
@ -4472,46 +4472,46 @@ invalid_range(exarg_T *eap)
+ (eap->cmdidx == CMD_diffget) + (eap->cmdidx == CMD_diffget)
#endif #endif
) )
return _(e_invrange); return _(e_invalid_range);
break; break;
case ADDR_ARGUMENTS: case ADDR_ARGUMENTS:
// add 1 if ARGCOUNT is 0 // add 1 if ARGCOUNT is 0
if (eap->line2 > ARGCOUNT + (!ARGCOUNT)) if (eap->line2 > ARGCOUNT + (!ARGCOUNT))
return _(e_invrange); return _(e_invalid_range);
break; break;
case ADDR_BUFFERS: case ADDR_BUFFERS:
// Only a boundary check, not whether the buffers actually // Only a boundary check, not whether the buffers actually
// exist. // exist.
if (eap->line1 < 1 || eap->line2 > get_highest_fnum()) if (eap->line1 < 1 || eap->line2 > get_highest_fnum())
return _(e_invrange); return _(e_invalid_range);
break; break;
case ADDR_LOADED_BUFFERS: case ADDR_LOADED_BUFFERS:
buf = firstbuf; buf = firstbuf;
while (buf->b_ml.ml_mfp == NULL) while (buf->b_ml.ml_mfp == NULL)
{ {
if (buf->b_next == NULL) if (buf->b_next == NULL)
return _(e_invrange); return _(e_invalid_range);
buf = buf->b_next; buf = buf->b_next;
} }
if (eap->line1 < buf->b_fnum) if (eap->line1 < buf->b_fnum)
return _(e_invrange); return _(e_invalid_range);
buf = lastbuf; buf = lastbuf;
while (buf->b_ml.ml_mfp == NULL) while (buf->b_ml.ml_mfp == NULL)
{ {
if (buf->b_prev == NULL) if (buf->b_prev == NULL)
return _(e_invrange); return _(e_invalid_range);
buf = buf->b_prev; buf = buf->b_prev;
} }
if (eap->line2 > buf->b_fnum) if (eap->line2 > buf->b_fnum)
return _(e_invrange); return _(e_invalid_range);
break; break;
case ADDR_WINDOWS: case ADDR_WINDOWS:
if (eap->line2 > LAST_WIN_NR) if (eap->line2 > LAST_WIN_NR)
return _(e_invrange); return _(e_invalid_range);
break; break;
case ADDR_TABS: case ADDR_TABS:
if (eap->line2 > LAST_TAB_NR) if (eap->line2 > LAST_TAB_NR)
return _(e_invrange); return _(e_invalid_range);
break; break;
case ADDR_TABS_RELATIVE: case ADDR_TABS_RELATIVE:
case ADDR_OTHER: case ADDR_OTHER:
@ -4521,14 +4521,14 @@ invalid_range(exarg_T *eap)
#ifdef FEAT_QUICKFIX #ifdef FEAT_QUICKFIX
// No error for value that is too big, will use the last entry. // No error for value that is too big, will use the last entry.
if (eap->line2 <= 0) if (eap->line2 <= 0)
return _(e_invrange); return _(e_invalid_range);
#endif #endif
break; break;
case ADDR_QUICKFIX_VALID: case ADDR_QUICKFIX_VALID:
#ifdef FEAT_QUICKFIX #ifdef FEAT_QUICKFIX
if ((eap->line2 != 1 && eap->line2 > qf_get_valid_size(eap)) if ((eap->line2 != 1 && eap->line2 > qf_get_valid_size(eap))
|| eap->line2 < 0) || eap->line2 < 0)
return _(e_invrange); return _(e_invalid_range);
#endif #endif
break; break;
case ADDR_UNSIGNED: case ADDR_UNSIGNED:
@ -5187,7 +5187,8 @@ ex_autocmd(exarg_T *eap)
if (secure) if (secure)
{ {
secure = 2; secure = 2;
eap->errmsg = _(e_curdir); eap->errmsg =
_(e_command_not_allowed_from_vimrc_in_current_dir_or_tag_search);
} }
else if (eap->cmdidx == CMD_autocmd) else if (eap->cmdidx == CMD_autocmd)
do_autocmd(eap->arg, eap->forceit); do_autocmd(eap->arg, eap->forceit);
@ -5842,7 +5843,7 @@ get_tabpage_arg(exarg_T *eap)
{ {
if (unaccept_arg0 && eap->line2 == 0) if (unaccept_arg0 && eap->line2 == 0)
{ {
eap->errmsg = _(e_invrange); eap->errmsg = _(e_invalid_range);
tab_number = 0; tab_number = 0;
} }
else else
@ -5852,7 +5853,7 @@ get_tabpage_arg(exarg_T *eap)
{ {
--tab_number; --tab_number;
if (tab_number < unaccept_arg0) if (tab_number < unaccept_arg0)
eap->errmsg = _(e_invrange); eap->errmsg = _(e_invalid_range);
} }
} }
} }
@ -6564,7 +6565,7 @@ ex_tabnext(exarg_T *eap)
tab_number = eap->line2; tab_number = eap->line2;
if (tab_number < 1) if (tab_number < 1)
{ {
eap->errmsg = _(e_invrange); eap->errmsg = _(e_invalid_range);
return; return;
} }
} }
@ -7715,7 +7716,7 @@ ex_copymove(exarg_T *eap)
*/ */
if (n == MAXLNUM || n < 0 || n > curbuf->b_ml.ml_line_count) if (n == MAXLNUM || n < 0 || n > curbuf->b_ml.ml_line_count)
{ {
emsg(_(e_invrange)); emsg(_(e_invalid_range));
return; return;
} }
@ -8163,7 +8164,7 @@ open_exfile(
// with Unix it is possible to open a directory // with Unix it is possible to open a directory
if (mch_isdir(fname)) if (mch_isdir(fname))
{ {
semsg(_(e_isadir2), fname); semsg(_(e_src_is_directory), fname);
return NULL; return NULL;
} }
#endif #endif

View File

@ -2622,7 +2622,7 @@ get_text_locked_msg(void)
{ {
#ifdef FEAT_CMDWIN #ifdef FEAT_CMDWIN
if (cmdwin_type != 0) if (cmdwin_type != 0)
return e_cmdwin; return e_invalid_in_cmdline_window;
#endif #endif
if (textwinlock != 0) if (textwinlock != 0)
return e_textwinlock; return e_textwinlock;

View File

@ -856,7 +856,7 @@ f_delete(typval_T *argvars, typval_T *rettv)
// delete a directory recursively // delete a directory recursively
rettv->vval.v_number = delete_recursive(name); rettv->vval.v_number = delete_recursive(name);
else else
semsg(_(e_invexpr2), flags); semsg(_(e_invalid_expression_str), flags);
} }
/* /*
@ -1685,7 +1685,7 @@ read_file_or_blob(typval_T *argvars, typval_T *rettv, int always_blob)
if (mch_isdir(fname)) if (mch_isdir(fname))
{ {
semsg(_(e_isadir2), fname); semsg(_(e_src_is_directory), fname);
return; return;
} }
if (*fname == NUL || (fd = mch_fopen((char *)fname, READBIN)) == NULL) if (*fname == NUL || (fd = mch_fopen((char *)fname, READBIN)) == NULL)

View File

@ -1762,7 +1762,7 @@ foldCreateMarkers(linenr_T start, linenr_T end)
{ {
if (!curbuf->b_p_ma) if (!curbuf->b_p_ma)
{ {
emsg(_(e_modifiable)); emsg(_(e_cannot_make_changes_modifiable_is_off));
return; return;
} }
parseMarker(curwin); parseMarker(curwin);

View File

@ -1447,7 +1447,7 @@ openscript(
{ {
if (curscript + 1 == NSCRIPT) if (curscript + 1 == NSCRIPT)
{ {
emsg(_(e_nesting)); emsg(_(e_scripts_nested_too_deep));
return; return;
} }

View File

@ -1581,11 +1581,6 @@ EXTERN int netbeansSuppressNoLines INIT(= 0); // skip "No lines in buffer"
*/ */
EXTERN char e_abort[] INIT(= N_("E470: Command aborted")); EXTERN char e_abort[] INIT(= N_("E470: Command aborted"));
EXTERN char e_argreq[] INIT(= N_("E471: Argument required")); EXTERN char e_argreq[] INIT(= N_("E471: Argument required"));
EXTERN char e_backslash[] INIT(= N_("E10: \\ should be followed by /, ? or &"));
#ifdef FEAT_CMDWIN
EXTERN char e_cmdwin[] INIT(= N_("E11: Invalid in command-line window; <CR> executes, CTRL-C quits"));
#endif
EXTERN char e_curdir[] INIT(= N_("E12: Command not allowed from exrc/vimrc in current dir or tag search"));
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
EXTERN char e_endif[] INIT(= N_("E171: Missing :endif")); EXTERN char e_endif[] INIT(= N_("E171: Missing :endif"));
EXTERN char e_catch[] INIT(= N_("E603: :catch without :try")); EXTERN char e_catch[] INIT(= N_("E603: :catch without :try"));
@ -1598,7 +1593,6 @@ EXTERN char e_endfor[] INIT(= N_("E170: Missing :endfor"));
EXTERN char e_while[] INIT(= N_("E588: :endwhile without :while")); EXTERN char e_while[] INIT(= N_("E588: :endwhile without :while"));
EXTERN char e_for[] INIT(= N_("E588: :endfor without :for")); EXTERN char e_for[] INIT(= N_("E588: :endfor without :for"));
#endif #endif
EXTERN char e_exists[] INIT(= N_("E13: File exists (add ! to override)"));
EXTERN char e_failed[] INIT(= N_("E472: Command failed")); EXTERN char e_failed[] INIT(= N_("E472: Command failed"));
#if defined(FEAT_GUI) && defined(FEAT_XFONTSET) #if defined(FEAT_GUI) && defined(FEAT_XFONTSET)
EXTERN char e_fontset[] INIT(= N_("E234: Unknown fontset: %s")); EXTERN char e_fontset[] INIT(= N_("E234: Unknown fontset: %s"));
@ -1618,13 +1612,6 @@ EXTERN char e_invarg2[] INIT(= N_("E475: Invalid argument: %s"));
EXTERN char e_duparg2[] INIT(= N_("E983: Duplicate 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_invargval[] INIT(= N_("E475: Invalid value for argument %s"));
EXTERN char e_invargNval[] INIT(= N_("E475: Invalid value for argument %s: %s")); EXTERN char e_invargNval[] INIT(= N_("E475: Invalid value for argument %s: %s"));
#ifdef FEAT_EVAL
EXTERN char e_invexpr2[] INIT(= N_("E15: Invalid expression: \"%s\""));
#endif
EXTERN char e_invrange[] INIT(= N_("E16: Invalid range"));
#if defined(UNIX) || defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
EXTERN char e_isadir2[] INIT(= N_("E17: \"%s\" is a directory"));
#endif
#ifdef FEAT_SPELL #ifdef FEAT_SPELL
EXTERN char e_no_spell[] INIT(= N_("E756: Spell checking is not possible")); EXTERN char e_no_spell[] INIT(= N_("E756: Spell checking is not possible"));
#endif #endif
@ -1646,12 +1633,6 @@ EXTERN char e_fsync[] INIT(= N_("E667: Fsync failed"));
EXTERN char e_loadlib[] INIT(= N_("E370: Could not load library %s")); EXTERN char e_loadlib[] INIT(= N_("E370: Could not load library %s"));
EXTERN char e_loadfunc[] INIT(= N_("E448: Could not load library function %s")); EXTERN char e_loadfunc[] INIT(= N_("E448: Could not load library function %s"));
#endif #endif
EXTERN char e_markinval[] INIT(= N_("E19: Mark has invalid line number"));
EXTERN char e_marknotset[] INIT(= N_("E20: Mark not set"));
EXTERN char e_modifiable[] INIT(= N_("E21: Cannot make changes, 'modifiable' is off"));
EXTERN char e_nesting[] INIT(= N_("E22: Scripts nested too deep"));
EXTERN char e_noalt[] INIT(= N_("E23: No alternate file"));
EXTERN char e_noabbr[] INIT(= N_("E24: No such abbreviation"));
EXTERN char e_nobang[] INIT(= N_("E477: No ! allowed")); EXTERN char e_nobang[] INIT(= N_("E477: No ! allowed"));
#if !defined(FEAT_GUI) || defined(VIMDLL) #if !defined(FEAT_GUI) || defined(VIMDLL)
EXTERN char e_nogvim[] INIT(= N_("E25: GUI cannot be used: Not enabled at compile time")); EXTERN char e_nogvim[] INIT(= N_("E25: GUI cannot be used: Not enabled at compile time"));
@ -1733,7 +1714,6 @@ EXTERN char e_listdictblobarg[] INIT(= N_("E896: Argument of %s must be a List,
EXTERN char e_modulus[] INIT(= N_("E804: Cannot use '%' with Float")); EXTERN char e_modulus[] INIT(= N_("E804: Cannot use '%' with Float"));
EXTERN char e_const_option[] INIT(= N_("E996: Cannot lock an option")); EXTERN char e_const_option[] INIT(= N_("E996: Cannot lock an option"));
EXTERN char e_unknown_option[] INIT(= N_("E113: Unknown option: %s")); EXTERN char e_unknown_option[] INIT(= N_("E113: Unknown option: %s"));
EXTERN char e_letunexp[] INIT(= N_("E18: Unexpected characters in :let"));
EXTERN char e_reduceempty[] INIT(= N_("E998: Reduce of an empty %s with no initial value")); EXTERN char e_reduceempty[] INIT(= N_("E998: Reduce of an empty %s with no initial value"));
EXTERN char e_no_dict_key[] INIT(= N_("E857: Dictionary key \"%s\" required")); EXTERN char e_no_dict_key[] INIT(= N_("E857: Dictionary key \"%s\" required"));
#endif #endif

View File

@ -991,7 +991,7 @@ op_reindent(oparg_T *oap, int (*how)(void))
// Don't even try when 'modifiable' is off. // Don't even try when 'modifiable' is off.
if (!curbuf->b_p_ma) if (!curbuf->b_p_ma)
{ {
emsg(_(e_modifiable)); emsg(_(e_cannot_make_changes_modifiable_is_off));
return; return;
} }

View File

@ -1556,7 +1556,7 @@ list_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg)
break; break;
} }
if (li == NULL) // didn't find "item2" after "item" if (li == NULL) // didn't find "item2" after "item"
emsg(_(e_invrange)); emsg(_(e_invalid_range));
else else
{ {
vimlist_remove(l, item, item2); vimlist_remove(l, item, item2);

View File

@ -2717,7 +2717,7 @@ do_exmap(exarg_T *eap, int isabbrev)
{ {
case 1: emsg(_(e_invarg)); case 1: emsg(_(e_invarg));
break; break;
case 2: emsg((isabbrev ? _(e_noabbr) : _(e_nomap))); case 2: emsg((isabbrev ? _(e_no_such_abbreviation) : _(e_nomap)));
break; break;
} }
} }

View File

@ -588,12 +588,12 @@ check_mark(pos_T *pos)
// lnum is negative if mark is in another file can can't get that // lnum is negative if mark is in another file can can't get that
// file, error message already give then. // file, error message already give then.
if (pos->lnum == 0) if (pos->lnum == 0)
emsg(_(e_marknotset)); emsg(_(e_mark_not_set));
return FAIL; return FAIL;
} }
if (pos->lnum > curbuf->b_ml.ml_line_count) if (pos->lnum > curbuf->b_ml.ml_line_count)
{ {
emsg(_(e_markinval)); emsg(_(e_mark_has_invalid_line_number));
return FAIL; return FAIL;
} }
return OK; return OK;

View File

@ -5210,7 +5210,7 @@ nv_Replace(cmdarg_T *cap)
else if (!checkclearopq(cap->oap)) else if (!checkclearopq(cap->oap))
{ {
if (!curbuf->b_p_ma) if (!curbuf->b_p_ma)
emsg(_(e_modifiable)); emsg(_(e_cannot_make_changes_modifiable_is_off));
else else
{ {
if (virtual_active()) if (virtual_active())
@ -5235,7 +5235,7 @@ nv_vreplace(cmdarg_T *cap)
else if (!checkclearopq(cap->oap)) else if (!checkclearopq(cap->oap))
{ {
if (!curbuf->b_p_ma) if (!curbuf->b_p_ma)
emsg(_(e_modifiable)); emsg(_(e_cannot_make_changes_modifiable_is_off));
else else
{ {
if (cap->extra_char == Ctrl_V) // get another character if (cap->extra_char == Ctrl_V) // get another character
@ -7075,7 +7075,7 @@ nv_edit(cmdarg_T *cap)
else if (!curbuf->b_p_ma && !p_im) else if (!curbuf->b_p_ma && !p_im)
{ {
// Only give this error when 'insertmode' is off. // Only give this error when 'insertmode' is off.
emsg(_(e_modifiable)); emsg(_(e_cannot_make_changes_modifiable_is_off));
clearop(cap->oap); clearop(cap->oap);
if (cap->cmdchar == K_PS) if (cap->cmdchar == K_PS)
// drop the pasted text // drop the pasted text

View File

@ -621,7 +621,7 @@ op_delete(oparg_T *oap)
if (!curbuf->b_p_ma) if (!curbuf->b_p_ma)
{ {
emsg(_(e_modifiable)); emsg(_(e_cannot_make_changes_modifiable_is_off));
return FAIL; return FAIL;
} }

View File

@ -971,7 +971,7 @@ ambw_end:
if (gvarp == &p_fenc) if (gvarp == &p_fenc)
{ {
if (!curbuf->b_p_ma && opt_flags != OPT_GLOBAL) if (!curbuf->b_p_ma && opt_flags != OPT_GLOBAL)
errmsg = e_modifiable; errmsg = e_cannot_make_changes_modifiable_is_off;
else if (vim_strchr(*varp, ',') != NULL) else if (vim_strchr(*varp, ',') != NULL)
// No comma allowed in 'fileencoding'; catches confusing it // No comma allowed in 'fileencoding'; catches confusing it
// with 'fileencodings'. // with 'fileencodings'.
@ -1130,7 +1130,7 @@ ambw_end:
else if (gvarp == &p_ff) else if (gvarp == &p_ff)
{ {
if (!curbuf->b_p_ma && !(opt_flags & OPT_GLOBAL)) if (!curbuf->b_p_ma && !(opt_flags & OPT_GLOBAL))
errmsg = e_modifiable; errmsg = e_cannot_make_changes_modifiable_is_off;
else if (check_opt_strings(*varp, p_ff_values, FALSE) != OK) else if (check_opt_strings(*varp, p_ff_values, FALSE) != OK)
errmsg = e_invarg; errmsg = e_invarg;
else else

View File

@ -61,7 +61,7 @@ popup_options_one(dict_T *dict, char_u *key)
n = strtol((char *)s, (char **)&endp, 10); n = strtol((char *)s, (char **)&endp, 10);
if (endp != NULL && *skipwhite(endp) != NUL) if (endp != NULL && *skipwhite(endp) != NUL)
{ {
semsg(_(e_invexpr2), val); semsg(_(e_invalid_expression_str), val);
return 0; return 0;
} }
} }

View File

@ -3830,7 +3830,7 @@ qf_history(exarg_T *eap)
qf_update_buffer(qi, NULL); qf_update_buffer(qi, NULL);
} }
else else
emsg(_(e_invrange)); emsg(_(e_invalid_range));
return; return;
} }
@ -5655,7 +5655,7 @@ ex_cbelow(exarg_T *eap)
if (eap->addr_count > 0 && eap->line2 <= 0) if (eap->addr_count > 0 && eap->line2 <= 0)
{ {
emsg(_(e_invrange)); emsg(_(e_invalid_range));
return; return;
} }
@ -7817,7 +7817,7 @@ cbuffer_process_args(
if (eap->line1 < 1 || eap->line1 > buf->b_ml.ml_line_count if (eap->line1 < 1 || eap->line1 > buf->b_ml.ml_line_count
|| eap->line2 < 1 || eap->line2 > buf->b_ml.ml_line_count) || eap->line2 < 1 || eap->line2 > buf->b_ml.ml_line_count)
{ {
emsg(_(e_invrange)); emsg(_(e_invalid_range));
return FAIL; return FAIL;
} }

View File

@ -5972,12 +5972,12 @@ mkspell(
// time. // time.
if (!over_write && mch_stat((char *)wfname, &st) >= 0) if (!over_write && mch_stat((char *)wfname, &st) >= 0)
{ {
emsg(_(e_exists)); emsg(_(e_file_exists));
goto theend; goto theend;
} }
if (mch_isdir(wfname)) if (mch_isdir(wfname))
{ {
semsg(_(e_isadir2), wfname); semsg(_(e_src_is_directory), wfname);
goto theend; goto theend;
} }

View File

@ -549,7 +549,7 @@ f_prop_clear(typval_T *argvars, typval_T *rettv UNUSED)
} }
if (start < 1 || end < 1) if (start < 1 || end < 1)
{ {
emsg(_(e_invrange)); emsg(_(e_invalid_range));
return; return;
} }
@ -646,7 +646,7 @@ f_prop_find(typval_T *argvars, typval_T *rettv)
if (lnum < 1 || lnum > buf->b_ml.ml_line_count) if (lnum < 1 || lnum > buf->b_ml.ml_line_count)
{ {
emsg(_(e_invrange)); emsg(_(e_invalid_range));
return; return;
} }
@ -779,7 +779,7 @@ f_prop_list(typval_T *argvars, typval_T *rettv)
} }
if (lnum < 1 || lnum > buf->b_ml.ml_line_count) if (lnum < 1 || lnum > buf->b_ml.ml_line_count)
{ {
emsg(_(e_invrange)); emsg(_(e_invalid_range));
return; return;
} }
@ -839,7 +839,7 @@ f_prop_remove(typval_T *argvars, typval_T *rettv)
end = tv_get_number(&argvars[2]); end = tv_get_number(&argvars[2]);
if (start < 1 || end < 1) if (start < 1 || end < 1)
{ {
emsg(_(e_invrange)); emsg(_(e_invalid_range));
return; return;
} }
} }

View File

@ -1328,7 +1328,7 @@ eval_number(
: STR2NR_ALL, &n, NULL, 0, TRUE); : STR2NR_ALL, &n, NULL, 0, TRUE);
if (len == 0) if (len == 0)
{ {
semsg(_(e_invexpr2), *arg); semsg(_(e_invalid_expression_str), *arg);
return FAIL; return FAIL;
} }
*arg += len; *arg += len;

View File

@ -316,7 +316,7 @@ undo_allowed(void)
// Don't allow changes when 'modifiable' is off. // Don't allow changes when 'modifiable' is off.
if (!curbuf->b_p_ma) if (!curbuf->b_p_ma)
{ {
emsg(_(e_modifiable)); emsg(_(e_cannot_make_changes_modifiable_is_off));
return FALSE; return FALSE;
} }

View File

@ -4864,7 +4864,7 @@ ex_call(exarg_T *eap)
{ {
// If the function deleted lines or switched to another buffer // If the function deleted lines or switched to another buffer
// the line number may become invalid. // the line number may become invalid.
emsg(_(e_invrange)); emsg(_(e_invalid_range));
break; break;
} }
curwin->w_cursor.lnum = lnum; curwin->w_cursor.lnum = lnum;

View File

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

View File

@ -4991,7 +4991,7 @@ compile_expr4(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
} }
if (type_is && (p[len] == '?' || p[len] == '#')) if (type_is && (p[len] == '?' || p[len] == '#'))
{ {
semsg(_(e_invexpr2), *arg); semsg(_(e_invalid_expression_str), *arg);
return FAIL; return FAIL;
} }
// extra question mark appended: ignore case // extra question mark appended: ignore case
@ -5821,7 +5821,7 @@ get_var_dest(
if (p == NULL) if (p == NULL)
{ {
// cannot happen? // cannot happen?
emsg(_(e_letunexp)); emsg(_(e_unexpected_characters_in_assignment));
return FAIL; return FAIL;
} }
cc = *p; cc = *p;

View File

@ -130,7 +130,7 @@ do_window(
do { \ do { \
if (cmdwin_type != 0) \ if (cmdwin_type != 0) \
{ \ { \
emsg(_(e_cmdwin)); \ emsg(_(e_invalid_in_cmdline_window)); \
return; \ return; \
} \ } \
} while (0) } while (0)
@ -187,7 +187,7 @@ do_window(
? curwin->w_alt_fnum : Prenum) == NULL) ? curwin->w_alt_fnum : Prenum) == NULL)
{ {
if (Prenum == 0) if (Prenum == 0)
emsg(_(e_noalt)); emsg(_(e_no_alternate_file));
else else
semsg(_("E92: Buffer %ld not found"), Prenum); semsg(_("E92: Buffer %ld not found"), Prenum);
break; break;