To: vim_dev@googlegroups.com Subject: Patch 8.2.3069 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3069 Problem: Error messages are spread out. Solution: Move some error messages to errors.h. Use clearer names. Files: src/errors.h, src/globals.h, src/arglist.c, src/buffer.c, src/channel.c, src/eval.c, src/evalfunc.c, src/evalvars.c, src/evalwindow.c, src/ex_cmds.c, src/ex_docmd.c, src/ex_getln.c, src/filepath.c, src/fold.c, src/getchar.c, src/indent.c, src/list.c, src/map.c, src/mark.c, src/normal.c, src/ops.c, src/optionstr.c, src/popupwin.c, src/quickfix.c, src/spellfile.c, src/textprop.c, src/typval.c, src/undo.c, src/userfunc.c, src/vim9compile.c, src/window.c *** ../vim-8.2.3068/src/errors.h 2021-06-26 15:00:55.881276189 +0200 --- src/errors.h 2021-06-27 21:59:49.030104138 +0200 *************** *** 10,15 **** --- 10,53 ---- * 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; 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 EXTERN char e_undefined_variable_str[] INIT(= N_("E121: Undefined variable: %s")); *** ../vim-8.2.3068/src/globals.h 2021-06-17 21:03:04.038634999 +0200 --- src/globals.h 2021-06-27 21:53:10.778805355 +0200 *************** *** 1581,1591 **** */ EXTERN char e_abort[] INIT(= N_("E470: Command aborted")); 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; 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 EXTERN char e_endif[] INIT(= N_("E171: Missing :endif")); EXTERN char e_catch[] INIT(= N_("E603: :catch without :try")); --- 1581,1586 ---- *************** *** 1598,1604 **** EXTERN char e_while[] INIT(= N_("E588: :endwhile without :while")); EXTERN char e_for[] INIT(= N_("E588: :endfor without :for")); #endif - EXTERN char e_exists[] INIT(= N_("E13: File exists (add ! to override)")); 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")); --- 1593,1598 ---- *************** *** 1618,1630 **** 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_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 EXTERN char e_no_spell[] INIT(= N_("E756: Spell checking is not possible")); #endif --- 1612,1617 ---- *************** *** 1646,1657 **** 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")); #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")); #if !defined(FEAT_GUI) || defined(VIMDLL) EXTERN char e_nogvim[] INIT(= N_("E25: GUI cannot be used: Not enabled at compile time")); --- 1633,1638 ---- *************** *** 1733,1739 **** 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_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_no_dict_key[] INIT(= N_("E857: Dictionary key \"%s\" required")); #endif --- 1714,1719 ---- *** ../vim-8.2.3068/src/arglist.c 2021-02-03 21:23:25.319581856 +0100 --- src/arglist.c 2021-06-27 21:46:09.763581009 +0200 *************** *** 832,838 **** { // Don't give an error for ":%argdel" if the list is empty. if (eap->line1 != 1 || eap->line2 != 0) ! emsg(_(e_invrange)); } else { --- 832,838 ---- { // Don't give an error for ":%argdel" if the list is empty. if (eap->line1 != 1 || eap->line2 != 0) ! emsg(_(e_invalid_range)); } else { *************** *** 920,926 **** #ifdef FEAT_CMDWIN if (cmdwin_type != 0) { ! emsg(_(e_cmdwin)); return; } #endif --- 920,926 ---- #ifdef FEAT_CMDWIN if (cmdwin_type != 0) { ! emsg(_(e_invalid_in_cmdline_window)); return; } #endif *** ../vim-8.2.3068/src/buffer.c 2021-06-10 21:07:45.411050902 +0200 --- src/buffer.c 2021-06-27 21:59:05.826181514 +0200 *************** *** 2407,2413 **** if (buf == NULL) { if ((options & GETF_ALT) && n == 0) ! emsg(_(e_noalt)); else semsg(_("E92: Buffer %d not found"), n); return FAIL; --- 2407,2413 ---- if (buf == NULL) { if ((options & GETF_ALT) && n == 0) ! emsg(_(e_no_alternate_file)); else semsg(_("E92: Buffer %d not found"), n); return FAIL; *************** *** 3516,3522 **** if (buflist_name_nr(0, &fname, &dummy) == FAIL) { if (errmsg) ! emsg(_(e_noalt)); return NULL; } return fname; --- 3516,3522 ---- if (buflist_name_nr(0, &fname, &dummy) == FAIL) { if (errmsg) ! emsg(_(e_no_alternate_file)); return NULL; } return fname; *** ../vim-8.2.3068/src/channel.c 2021-06-05 20:51:34.737122348 +0200 --- src/channel.c 2021-06-27 22:02:07.053855547 +0200 *************** *** 1232,1238 **** if (!buf->b_p_ma && !channel->ch_part[PART_OUT].ch_nomodifiable) { ! emsg(_(e_modifiable)); } else { --- 1232,1238 ---- if (!buf->b_p_ma && !channel->ch_part[PART_OUT].ch_nomodifiable) { ! emsg(_(e_cannot_make_changes_modifiable_is_off)); } else { *************** *** 1278,1284 **** !opt->jo_modifiable[PART_ERR]; if (!buf->b_p_ma && !channel->ch_part[PART_ERR].ch_nomodifiable) { ! emsg(_(e_modifiable)); } else { --- 1278,1284 ---- !opt->jo_modifiable[PART_ERR]; if (!buf->b_p_ma && !channel->ch_part[PART_ERR].ch_nomodifiable) { ! emsg(_(e_cannot_make_changes_modifiable_is_off)); } else { *** ../vim-8.2.3068/src/eval.c 2021-06-27 15:04:00.784722722 +0200 --- src/eval.c 2021-06-27 21:44:14.611794655 +0200 *************** *** 216,222 **** // Also check called_emsg for when using assert_fails(). if (!aborting() && did_emsg == did_emsg_before && called_emsg == called_emsg_before) ! semsg(_(e_invexpr2), start); } clear_evalarg(&evalarg, eap); return ret; --- 216,222 ---- // Also check called_emsg for when using assert_fails(). if (!aborting() && did_emsg == did_emsg_before && called_emsg == called_emsg_before) ! semsg(_(e_invalid_expression_str), start); } clear_evalarg(&evalarg, eap); return ret; *************** *** 297,303 **** if (*skipwhite(s) != NUL) // check for trailing chars after expr { clear_tv(rettv); ! semsg(_(e_invexpr2), s); return FAIL; } } --- 297,303 ---- if (*skipwhite(s) != NUL) // check for trailing chars after expr { clear_tv(rettv); ! semsg(_(e_invalid_expression_str), s); return FAIL; } } *************** *** 2268,2274 **** if (end_error) semsg(_(e_trailing_arg), p); else ! semsg(_(e_invexpr2), arg); } // Some of the expression may not have been consumed. Do not check for --- 2268,2274 ---- if (end_error) semsg(_(e_trailing_arg), p); else ! semsg(_(e_invalid_expression_str), arg); } // Some of the expression may not have been consumed. Do not check for *************** *** 2758,2764 **** if (vim9script && type_is && (p[len] == '?' || p[len] == '#')) { ! semsg(_(e_invexpr2), p); clear_tv(rettv); return FAIL; } --- 2758,2764 ---- if (vim9script && type_is && (p[len] == '?' || p[len] == '#')) { ! semsg(_(e_invalid_expression_str), p); clear_tv(rettv); return FAIL; } *************** *** 3367,3373 **** // ++, --, -+ and +- are not accepted in Vim9 script if (vim9 && (*p == '-' || *p == '+') && (*n == '-' || *n == '+')) { ! semsg(_(e_invexpr2), s); return FAIL; } p = n; --- 3367,3373 ---- // ++, --, -+ and +- are not accepted in Vim9 script if (vim9 && (*p == '-' || *p == '+') && (*n == '-' || *n == '+')) { ! semsg(_(e_invalid_expression_str), s); return FAIL; } p = n; *************** *** 3441,3447 **** #endif )) { ! semsg(_(e_invexpr2), *arg); ++*arg; return FAIL; } --- 3441,3447 ---- #endif )) { ! semsg(_(e_invalid_expression_str), *arg); ++*arg; return FAIL; } *************** *** 5607,5613 **** // Only give an error when there is something, otherwise it will be // reported at a higher level. if (len == 0 && verbose && **arg != NUL) ! semsg(_(e_invexpr2), *arg); return len; } --- 5607,5613 ---- // Only give an error when there is something, otherwise it will be // reported at a higher level. if (len == 0 && verbose && **arg != NUL) ! semsg(_(e_invalid_expression_str), *arg); return len; } *************** *** 6153,6159 **** */ if (!aborting() && did_emsg == did_emsg_before && called_emsg == called_emsg_before) ! semsg(_(e_invexpr2), arg_start); need_clr_eos = FALSE; break; } --- 6153,6159 ---- */ if (!aborting() && did_emsg == did_emsg_before && called_emsg == called_emsg_before) ! semsg(_(e_invalid_expression_str), arg_start); need_clr_eos = FALSE; break; } *** ../vim-8.2.3068/src/evalfunc.c 2021-06-27 19:02:48.985931140 +0200 --- src/evalfunc.c 2021-06-27 21:44:29.719766690 +0200 *************** *** 2923,2929 **** if (s == NULL || eval1(&s, rettv, &EVALARG_EVALUATE) == FAIL) { if (p != NULL && !aborting()) ! semsg(_(e_invexpr2), p); need_clr_eos = FALSE; rettv->v_type = VAR_NUMBER; rettv->vval.v_number = 0; --- 2923,2929 ---- if (s == NULL || eval1(&s, rettv, &EVALARG_EVALUATE) == FAIL) { if (p != NULL && !aborting()) ! semsg(_(e_invalid_expression_str), p); need_clr_eos = FALSE; rettv->v_type = VAR_NUMBER; rettv->vval.v_number = 0; *** ../vim-8.2.3068/src/evalvars.c 2021-06-14 21:32:16.538794967 +0200 --- src/evalvars.c 2021-06-27 21:50:44.151069767 +0200 *************** *** 1334,1340 **** semsg(_(e_letwrong), op); else if (endchars != NULL && vim_strchr(endchars, *skipwhite(arg)) == NULL) ! emsg(_(e_letunexp)); else if (!check_secure()) { c1 = name[len]; --- 1334,1340 ---- semsg(_(e_letwrong), op); else if (endchars != NULL && vim_strchr(endchars, *skipwhite(arg)) == NULL) ! emsg(_(e_unexpected_characters_in_let)); else if (!check_secure()) { c1 = name[len]; *************** *** 1379,1385 **** p = find_option_end(&arg, &opt_flags); if (p == NULL || (endchars != NULL && vim_strchr(endchars, *skipwhite(p)) == NULL)) ! emsg(_(e_letunexp)); else { long n = 0; --- 1379,1385 ---- p = find_option_end(&arg, &opt_flags); if (p == NULL || (endchars != NULL && vim_strchr(endchars, *skipwhite(p)) == NULL)) ! emsg(_(e_unexpected_characters_in_let)); else { long n = 0; *************** *** 1481,1487 **** semsg(_(e_letwrong), op); else if (endchars != NULL && vim_strchr(endchars, *skipwhite(arg + 1)) == NULL) ! emsg(_(e_letunexp)); else { char_u *ptofree = NULL; --- 1481,1487 ---- semsg(_(e_letwrong), op); else if (endchars != NULL && vim_strchr(endchars, *skipwhite(arg + 1)) == NULL) ! emsg(_(e_unexpected_characters_in_let)); else { char_u *ptofree = NULL; *************** *** 1520,1526 **** { if (endchars != NULL && vim_strchr(endchars, *skipwhite(lv.ll_name_end)) == NULL) ! emsg(_(e_letunexp)); else { set_var_lval(&lv, p, tv, copy, flags, op, var_idx); --- 1520,1526 ---- { if (endchars != NULL && vim_strchr(endchars, *skipwhite(lv.ll_name_end)) == NULL) ! emsg(_(e_unexpected_characters_in_let)); else { set_var_lval(&lv, p, tv, copy, flags, op, var_idx); *** ../vim-8.2.3068/src/evalwindow.c 2021-03-20 19:55:31.660402769 +0100 --- src/evalwindow.c 2021-06-27 21:44:44.875738568 +0200 *************** *** 363,369 **** if (invalid_arg) { ! semsg(_(e_invexpr2), arg); nr = 0; } } --- 363,369 ---- if (invalid_arg) { ! semsg(_(e_invalid_expression_str), arg); nr = 0; } } *************** *** 636,642 **** nr = valid_tabpage(lastused_tabpage) ? tabpage_index(lastused_tabpage) : 0; else ! semsg(_(e_invexpr2), arg); } } else --- 636,642 ---- nr = valid_tabpage(lastused_tabpage) ? tabpage_index(lastused_tabpage) : 0; else ! semsg(_(e_invalid_expression_str), arg); } } else *************** *** 726,732 **** #ifdef FEAT_CMDWIN if (cmdwin_type != 0) { ! emsg(_(e_cmdwin)); return; } #endif --- 726,732 ---- #ifdef FEAT_CMDWIN if (cmdwin_type != 0) { ! emsg(_(e_invalid_in_cmdline_window)); return; } #endif *** ../vim-8.2.3068/src/ex_cmds.c 2021-06-21 21:55:14.692257295 +0200 --- src/ex_cmds.c 2021-06-27 21:55:46.538534690 +0200 *************** *** 2120,2126 **** // with UNIX it is possible to open a directory if (mch_isdir(ffname)) { ! semsg(_(e_isadir2), ffname); return FAIL; } #endif --- 2120,2126 ---- // with UNIX it is possible to open a directory if (mch_isdir(ffname)) { ! semsg(_(e_src_is_directory), ffname); return FAIL; } #endif *************** *** 2137,2143 **** else #endif { ! emsg(_(e_exists)); return FAIL; } } --- 2137,2143 ---- else #endif { ! emsg(_(e_file_exists)); return FAIL; } } *************** *** 3586,3592 **** if (secure) { secure = 2; ! emsg(_(e_curdir)); return TRUE; } #ifdef HAVE_SANDBOX --- 3586,3592 ---- if (secure) { secure = 2; ! emsg(_(e_command_not_allowed_from_vimrc_in_current_dir_or_tag_search)); return TRUE; } #ifdef HAVE_SANDBOX *************** *** 3729,3735 **** ++cmd; if (vim_strchr((char_u *)"/?&", *cmd) == NULL) { ! emsg(_(e_backslash)); return; } if (*cmd != '&') --- 3729,3735 ---- ++cmd; if (vim_strchr((char_u *)"/?&", *cmd) == NULL) { ! emsg(_(e_backslash_should_be_followed_by)); return; } if (*cmd != '&') *************** *** 3944,3950 **** if (!subflags.do_count && !curbuf->b_p_ma) { // Substitution is not allowed in non-'modifiable' buffer ! emsg(_(e_modifiable)); return; } --- 3944,3950 ---- if (!subflags.do_count && !curbuf->b_p_ma) { // Substitution is not allowed in non-'modifiable' buffer ! emsg(_(e_cannot_make_changes_modifiable_is_off)); return; } *************** *** 4903,4909 **** ++cmd; if (vim_strchr((char_u *)"/?&", *cmd) == NULL) { ! emsg(_(e_backslash)); return; } if (*cmd == '&') --- 4903,4909 ---- ++cmd; if (vim_strchr((char_u *)"/?&", *cmd) == NULL) { ! emsg(_(e_backslash_should_be_followed_by)); return; } if (*cmd == '&') *** ../vim-8.2.3068/src/ex_docmd.c 2021-06-21 19:43:59.146216296 +0200 --- src/ex_docmd.c 2021-06-27 21:55:51.322526294 +0200 *************** *** 1997,2003 **** } if (ea.line2 < 0) ! errormsg = _(e_invrange); else { if (ea.line2 == 0) --- 1997,2003 ---- } if (ea.line2 < 0) ! errormsg = _(e_invalid_range); else { if (ea.line2 == 0) *************** *** 2124,2130 **** if (!curbuf->b_p_ma && (ea.argt & EX_MODIFY)) { // Command not allowed in non-'modifiable' buffer ! errormsg = _(e_modifiable); goto doend; } --- 2124,2130 ---- if (!curbuf->b_p_ma && (ea.argt & EX_MODIFY)) { // Command not allowed in non-'modifiable' buffer ! errormsg = _(e_cannot_make_changes_modifiable_is_off); goto doend; } *************** *** 2134,2140 **** if (cmdwin_type != 0 && !(ea.argt & EX_CMDWIN)) { // Command not allowed in the command line window ! errormsg = _(e_cmdwin); goto doend; } #endif --- 2134,2140 ---- if (cmdwin_type != 0 && !(ea.argt & EX_CMDWIN)) { // Command not allowed in the command line window ! errormsg = _(e_invalid_in_cmdline_window); goto doend; } #endif *************** *** 2996,3002 **** { if (tabnr < 0 || tabnr > LAST_TAB_NR) { ! *errormsg = _(e_invrange); return FAIL; } cmod->cmod_tab = tabnr + 1; --- 2996,3002 ---- { if (tabnr < 0 || tabnr > LAST_TAB_NR) { ! *errormsg = _(e_invalid_range); return FAIL; } cmod->cmod_tab = tabnr + 1; *************** *** 3239,3252 **** { // there is no Vim command which uses '%' and // ADDR_WINDOWS or ADDR_TABS ! *errormsg = _(e_invrange); return FAIL; } break; case ADDR_TABS_RELATIVE: case ADDR_UNSIGNED: case ADDR_QUICKFIX: ! *errormsg = _(e_invrange); return FAIL; case ADDR_ARGUMENTS: if (ARGCOUNT == 0) --- 3239,3252 ---- { // there is no Vim command which uses '%' and // ADDR_WINDOWS or ADDR_TABS ! *errormsg = _(e_invalid_range); return FAIL; } break; case ADDR_TABS_RELATIVE: case ADDR_UNSIGNED: case ADDR_QUICKFIX: ! *errormsg = _(e_invalid_range); return FAIL; case ADDR_ARGUMENTS: if (ARGCOUNT == 0) *************** *** 3278,3284 **** // '*' - visual area if (eap->addr_type != ADDR_LINES) { ! *errormsg = _(e_invrange); return FAIL; } --- 3278,3284 ---- // '*' - visual area if (eap->addr_type != ADDR_LINES) { ! *errormsg = _(e_invalid_range); return FAIL; } *************** *** 3923,3929 **** if (addr_type == ADDR_NONE) emsg(_(e_norange)); else ! emsg(_(e_invrange)); } /* --- 3923,3929 ---- if (addr_type == ADDR_NONE) emsg(_(e_norange)); else ! emsg(_(e_invalid_range)); } /* *************** *** 4210,4216 **** i = RE_SEARCH; else { ! emsg(_(e_backslash)); cmd = NULL; goto error; } --- 4210,4216 ---- i = RE_SEARCH; else { ! emsg(_(e_backslash_should_be_followed_by)); cmd = NULL; goto error; } *************** *** 4312,4318 **** if (addr_type == ADDR_TABS_RELATIVE) { ! emsg(_(e_invrange)); cmd = NULL; goto error; } --- 4312,4318 ---- if (addr_type == ADDR_TABS_RELATIVE) { ! emsg(_(e_invalid_range)); cmd = NULL; goto error; } *************** *** 4460,4466 **** if ( eap->line1 < 0 || eap->line2 < 0 || eap->line1 > eap->line2) ! return _(e_invrange); if (eap->argt & EX_RANGE) { --- 4460,4466 ---- if ( eap->line1 < 0 || eap->line2 < 0 || eap->line1 > eap->line2) ! return _(e_invalid_range); if (eap->argt & EX_RANGE) { *************** *** 4472,4517 **** + (eap->cmdidx == CMD_diffget) #endif ) ! return _(e_invrange); break; case ADDR_ARGUMENTS: // add 1 if ARGCOUNT is 0 if (eap->line2 > ARGCOUNT + (!ARGCOUNT)) ! return _(e_invrange); break; case ADDR_BUFFERS: // Only a boundary check, not whether the buffers actually // exist. if (eap->line1 < 1 || eap->line2 > get_highest_fnum()) ! return _(e_invrange); break; case ADDR_LOADED_BUFFERS: buf = firstbuf; while (buf->b_ml.ml_mfp == NULL) { if (buf->b_next == NULL) ! return _(e_invrange); buf = buf->b_next; } if (eap->line1 < buf->b_fnum) ! return _(e_invrange); buf = lastbuf; while (buf->b_ml.ml_mfp == NULL) { if (buf->b_prev == NULL) ! return _(e_invrange); buf = buf->b_prev; } if (eap->line2 > buf->b_fnum) ! return _(e_invrange); break; case ADDR_WINDOWS: if (eap->line2 > LAST_WIN_NR) ! return _(e_invrange); break; case ADDR_TABS: if (eap->line2 > LAST_TAB_NR) ! return _(e_invrange); break; case ADDR_TABS_RELATIVE: case ADDR_OTHER: --- 4472,4517 ---- + (eap->cmdidx == CMD_diffget) #endif ) ! return _(e_invalid_range); break; case ADDR_ARGUMENTS: // add 1 if ARGCOUNT is 0 if (eap->line2 > ARGCOUNT + (!ARGCOUNT)) ! return _(e_invalid_range); break; case ADDR_BUFFERS: // Only a boundary check, not whether the buffers actually // exist. if (eap->line1 < 1 || eap->line2 > get_highest_fnum()) ! return _(e_invalid_range); break; case ADDR_LOADED_BUFFERS: buf = firstbuf; while (buf->b_ml.ml_mfp == NULL) { if (buf->b_next == NULL) ! return _(e_invalid_range); buf = buf->b_next; } if (eap->line1 < buf->b_fnum) ! return _(e_invalid_range); buf = lastbuf; while (buf->b_ml.ml_mfp == NULL) { if (buf->b_prev == NULL) ! return _(e_invalid_range); buf = buf->b_prev; } if (eap->line2 > buf->b_fnum) ! return _(e_invalid_range); break; case ADDR_WINDOWS: if (eap->line2 > LAST_WIN_NR) ! return _(e_invalid_range); break; case ADDR_TABS: if (eap->line2 > LAST_TAB_NR) ! return _(e_invalid_range); break; case ADDR_TABS_RELATIVE: case ADDR_OTHER: *************** *** 4521,4534 **** #ifdef FEAT_QUICKFIX // No error for value that is too big, will use the last entry. if (eap->line2 <= 0) ! return _(e_invrange); #endif break; case ADDR_QUICKFIX_VALID: #ifdef FEAT_QUICKFIX if ((eap->line2 != 1 && eap->line2 > qf_get_valid_size(eap)) || eap->line2 < 0) ! return _(e_invrange); #endif break; case ADDR_UNSIGNED: --- 4521,4534 ---- #ifdef FEAT_QUICKFIX // No error for value that is too big, will use the last entry. if (eap->line2 <= 0) ! return _(e_invalid_range); #endif break; case ADDR_QUICKFIX_VALID: #ifdef FEAT_QUICKFIX if ((eap->line2 != 1 && eap->line2 > qf_get_valid_size(eap)) || eap->line2 < 0) ! return _(e_invalid_range); #endif break; case ADDR_UNSIGNED: *************** *** 5187,5193 **** if (secure) { secure = 2; ! eap->errmsg = _(e_curdir); } else if (eap->cmdidx == CMD_autocmd) do_autocmd(eap->arg, eap->forceit); --- 5187,5194 ---- if (secure) { secure = 2; ! eap->errmsg = ! _(e_command_not_allowed_from_vimrc_in_current_dir_or_tag_search); } else if (eap->cmdidx == CMD_autocmd) do_autocmd(eap->arg, eap->forceit); *************** *** 5842,5848 **** { if (unaccept_arg0 && eap->line2 == 0) { ! eap->errmsg = _(e_invrange); tab_number = 0; } else --- 5843,5849 ---- { if (unaccept_arg0 && eap->line2 == 0) { ! eap->errmsg = _(e_invalid_range); tab_number = 0; } else *************** *** 5852,5858 **** { --tab_number; if (tab_number < unaccept_arg0) ! eap->errmsg = _(e_invrange); } } } --- 5853,5859 ---- { --tab_number; if (tab_number < unaccept_arg0) ! eap->errmsg = _(e_invalid_range); } } } *************** *** 6564,6570 **** tab_number = eap->line2; if (tab_number < 1) { ! eap->errmsg = _(e_invrange); return; } } --- 6565,6571 ---- tab_number = eap->line2; if (tab_number < 1) { ! eap->errmsg = _(e_invalid_range); return; } } *************** *** 7715,7721 **** */ if (n == MAXLNUM || n < 0 || n > curbuf->b_ml.ml_line_count) { ! emsg(_(e_invrange)); return; } --- 7716,7722 ---- */ if (n == MAXLNUM || n < 0 || n > curbuf->b_ml.ml_line_count) { ! emsg(_(e_invalid_range)); return; } *************** *** 8163,8169 **** // with Unix it is possible to open a directory if (mch_isdir(fname)) { ! semsg(_(e_isadir2), fname); return NULL; } #endif --- 8164,8170 ---- // with Unix it is possible to open a directory if (mch_isdir(fname)) { ! semsg(_(e_src_is_directory), fname); return NULL; } #endif *** ../vim-8.2.3068/src/ex_getln.c 2021-05-18 21:38:41.931029807 +0200 --- src/ex_getln.c 2021-06-27 21:37:58.440484723 +0200 *************** *** 2622,2628 **** { #ifdef FEAT_CMDWIN if (cmdwin_type != 0) ! return e_cmdwin; #endif if (textwinlock != 0) return e_textwinlock; --- 2622,2628 ---- { #ifdef FEAT_CMDWIN if (cmdwin_type != 0) ! return e_invalid_in_cmdline_window; #endif if (textwinlock != 0) return e_textwinlock; *** ../vim-8.2.3068/src/filepath.c 2021-06-06 14:14:35.352774336 +0200 --- src/filepath.c 2021-06-27 21:49:14.779236630 +0200 *************** *** 856,862 **** // delete a directory recursively rettv->vval.v_number = delete_recursive(name); else ! semsg(_(e_invexpr2), flags); } /* --- 856,862 ---- // delete a directory recursively rettv->vval.v_number = delete_recursive(name); else ! semsg(_(e_invalid_expression_str), flags); } /* *************** *** 1685,1691 **** if (mch_isdir(fname)) { ! semsg(_(e_isadir2), fname); return; } if (*fname == NUL || (fd = mch_fopen((char *)fname, READBIN)) == NULL) --- 1685,1691 ---- if (mch_isdir(fname)) { ! semsg(_(e_src_is_directory), fname); return; } if (*fname == NUL || (fd = mch_fopen((char *)fname, READBIN)) == NULL) *** ../vim-8.2.3068/src/fold.c 2021-02-01 19:24:52.066907936 +0100 --- src/fold.c 2021-06-27 21:55:56.010518057 +0200 *************** *** 1762,1768 **** { if (!curbuf->b_p_ma) { ! emsg(_(e_modifiable)); return; } parseMarker(curwin); --- 1762,1768 ---- { if (!curbuf->b_p_ma) { ! emsg(_(e_cannot_make_changes_modifiable_is_off)); return; } parseMarker(curwin); *** ../vim-8.2.3068/src/getchar.c 2021-06-07 22:04:48.402620082 +0200 --- src/getchar.c 2021-06-27 21:58:25.178254061 +0200 *************** *** 1447,1453 **** { if (curscript + 1 == NSCRIPT) { ! emsg(_(e_nesting)); return; } --- 1447,1453 ---- { if (curscript + 1 == NSCRIPT) { ! emsg(_(e_scripts_nested_too_deep)); return; } *** ../vim-8.2.3068/src/indent.c 2021-02-15 20:37:58.457374538 +0100 --- src/indent.c 2021-06-27 21:56:20.198475516 +0200 *************** *** 991,997 **** // Don't even try when 'modifiable' is off. if (!curbuf->b_p_ma) { ! emsg(_(e_modifiable)); return; } --- 991,997 ---- // Don't even try when 'modifiable' is off. if (!curbuf->b_p_ma) { ! emsg(_(e_cannot_make_changes_modifiable_is_off)); return; } *** ../vim-8.2.3068/src/list.c 2021-04-18 15:48:00.558271397 +0200 --- src/list.c 2021-06-27 21:47:06.179476171 +0200 *************** *** 1556,1562 **** break; } if (li == NULL) // didn't find "item2" after "item" ! emsg(_(e_invrange)); else { vimlist_remove(l, item, item2); --- 1556,1562 ---- break; } if (li == NULL) // didn't find "item2" after "item" ! emsg(_(e_invalid_range)); else { vimlist_remove(l, item, item2); *** ../vim-8.2.3068/src/map.c 2021-06-02 13:28:11.431120460 +0200 --- src/map.c 2021-06-27 21:59:58.342087444 +0200 *************** *** 2717,2723 **** { case 1: emsg(_(e_invarg)); break; ! case 2: emsg((isabbrev ? _(e_noabbr) : _(e_nomap))); break; } } --- 2717,2723 ---- { case 1: emsg(_(e_invarg)); break; ! case 2: emsg((isabbrev ? _(e_no_such_abbreviation) : _(e_nomap))); break; } } *** ../vim-8.2.3068/src/mark.c 2021-01-25 18:44:40.781678226 +0100 --- src/mark.c 2021-06-27 22:01:13.225952749 +0200 *************** *** 588,599 **** // lnum is negative if mark is in another file can can't get that // file, error message already give then. if (pos->lnum == 0) ! emsg(_(e_marknotset)); return FAIL; } if (pos->lnum > curbuf->b_ml.ml_line_count) { ! emsg(_(e_markinval)); return FAIL; } return OK; --- 588,599 ---- // lnum is negative if mark is in another file can can't get that // file, error message already give then. if (pos->lnum == 0) ! emsg(_(e_mark_not_set)); return FAIL; } if (pos->lnum > curbuf->b_ml.ml_line_count) { ! emsg(_(e_mark_has_invalid_line_number)); return FAIL; } return OK; *** ../vim-8.2.3068/src/normal.c 2021-06-10 19:39:07.277697688 +0200 --- src/normal.c 2021-06-27 21:56:48.954424789 +0200 *************** *** 5210,5216 **** else if (!checkclearopq(cap->oap)) { if (!curbuf->b_p_ma) ! emsg(_(e_modifiable)); else { if (virtual_active()) --- 5210,5216 ---- else if (!checkclearopq(cap->oap)) { if (!curbuf->b_p_ma) ! emsg(_(e_cannot_make_changes_modifiable_is_off)); else { if (virtual_active()) *************** *** 5235,5241 **** else if (!checkclearopq(cap->oap)) { if (!curbuf->b_p_ma) ! emsg(_(e_modifiable)); else { if (cap->extra_char == Ctrl_V) // get another character --- 5235,5241 ---- else if (!checkclearopq(cap->oap)) { if (!curbuf->b_p_ma) ! emsg(_(e_cannot_make_changes_modifiable_is_off)); else { if (cap->extra_char == Ctrl_V) // get another character *************** *** 7075,7081 **** else if (!curbuf->b_p_ma && !p_im) { // Only give this error when 'insertmode' is off. ! emsg(_(e_modifiable)); clearop(cap->oap); if (cap->cmdchar == K_PS) // drop the pasted text --- 7075,7081 ---- else if (!curbuf->b_p_ma && !p_im) { // Only give this error when 'insertmode' is off. ! emsg(_(e_cannot_make_changes_modifiable_is_off)); clearop(cap->oap); if (cap->cmdchar == K_PS) // drop the pasted text *** ../vim-8.2.3068/src/ops.c 2021-06-10 19:39:07.277697688 +0200 --- src/ops.c 2021-06-27 21:57:06.938392992 +0200 *************** *** 621,627 **** if (!curbuf->b_p_ma) { ! emsg(_(e_modifiable)); return FAIL; } --- 621,627 ---- if (!curbuf->b_p_ma) { ! emsg(_(e_cannot_make_changes_modifiable_is_off)); return FAIL; } *** ../vim-8.2.3068/src/optionstr.c 2021-06-20 14:01:25.984924607 +0200 --- src/optionstr.c 2021-06-27 21:57:34.986343297 +0200 *************** *** 971,977 **** if (gvarp == &p_fenc) { if (!curbuf->b_p_ma && opt_flags != OPT_GLOBAL) ! errmsg = e_modifiable; else if (vim_strchr(*varp, ',') != NULL) // No comma allowed in 'fileencoding'; catches confusing it // with 'fileencodings'. --- 971,977 ---- if (gvarp == &p_fenc) { if (!curbuf->b_p_ma && opt_flags != OPT_GLOBAL) ! errmsg = e_cannot_make_changes_modifiable_is_off; else if (vim_strchr(*varp, ',') != NULL) // No comma allowed in 'fileencoding'; catches confusing it // with 'fileencodings'. *************** *** 1130,1136 **** else if (gvarp == &p_ff) { if (!curbuf->b_p_ma && !(opt_flags & OPT_GLOBAL)) ! errmsg = e_modifiable; else if (check_opt_strings(*varp, p_ff_values, FALSE) != OK) errmsg = e_invarg; else --- 1130,1136 ---- else if (gvarp == &p_ff) { 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; else *** ../vim-8.2.3068/src/popupwin.c 2021-06-02 13:28:11.435120452 +0200 --- src/popupwin.c 2021-06-27 21:45:07.895695852 +0200 *************** *** 61,67 **** n = strtol((char *)s, (char **)&endp, 10); if (endp != NULL && *skipwhite(endp) != NUL) { ! semsg(_(e_invexpr2), val); return 0; } } --- 61,67 ---- n = strtol((char *)s, (char **)&endp, 10); if (endp != NULL && *skipwhite(endp) != NUL) { ! semsg(_(e_invalid_expression_str), val); return 0; } } *** ../vim-8.2.3068/src/quickfix.c 2021-06-19 20:45:07.349511367 +0200 --- src/quickfix.c 2021-06-27 21:47:40.979411407 +0200 *************** *** 3830,3836 **** qf_update_buffer(qi, NULL); } else ! emsg(_(e_invrange)); return; } --- 3830,3836 ---- qf_update_buffer(qi, NULL); } else ! emsg(_(e_invalid_range)); return; } *************** *** 5655,5661 **** if (eap->addr_count > 0 && eap->line2 <= 0) { ! emsg(_(e_invrange)); return; } --- 5655,5661 ---- if (eap->addr_count > 0 && eap->line2 <= 0) { ! emsg(_(e_invalid_range)); return; } *************** *** 7817,7823 **** if (eap->line1 < 1 || eap->line1 > buf->b_ml.ml_line_count || eap->line2 < 1 || eap->line2 > buf->b_ml.ml_line_count) { ! emsg(_(e_invrange)); return FAIL; } --- 7817,7823 ---- if (eap->line1 < 1 || eap->line1 > buf->b_ml.ml_line_count || eap->line2 < 1 || eap->line2 > buf->b_ml.ml_line_count) { ! emsg(_(e_invalid_range)); return FAIL; } *** ../vim-8.2.3068/src/spellfile.c 2021-06-11 19:07:36.734247944 +0200 --- src/spellfile.c 2021-06-27 21:49:22.295222608 +0200 *************** *** 5972,5983 **** // time. if (!over_write && mch_stat((char *)wfname, &st) >= 0) { ! emsg(_(e_exists)); goto theend; } if (mch_isdir(wfname)) { ! semsg(_(e_isadir2), wfname); goto theend; } --- 5972,5983 ---- // time. if (!over_write && mch_stat((char *)wfname, &st) >= 0) { ! emsg(_(e_file_exists)); goto theend; } if (mch_isdir(wfname)) { ! semsg(_(e_src_is_directory), wfname); goto theend; } *** ../vim-8.2.3068/src/textprop.c 2021-05-17 00:22:01.993641079 +0200 --- src/textprop.c 2021-06-27 21:47:53.255388557 +0200 *************** *** 549,555 **** } if (start < 1 || end < 1) { ! emsg(_(e_invrange)); return; } --- 549,555 ---- } if (start < 1 || end < 1) { ! emsg(_(e_invalid_range)); return; } *************** *** 646,652 **** if (lnum < 1 || lnum > buf->b_ml.ml_line_count) { ! emsg(_(e_invrange)); return; } --- 646,652 ---- if (lnum < 1 || lnum > buf->b_ml.ml_line_count) { ! emsg(_(e_invalid_range)); return; } *************** *** 779,785 **** } if (lnum < 1 || lnum > buf->b_ml.ml_line_count) { ! emsg(_(e_invrange)); return; } --- 779,785 ---- } if (lnum < 1 || lnum > buf->b_ml.ml_line_count) { ! emsg(_(e_invalid_range)); return; } *************** *** 839,845 **** end = tv_get_number(&argvars[2]); if (start < 1 || end < 1) { ! emsg(_(e_invrange)); return; } } --- 839,845 ---- end = tv_get_number(&argvars[2]); if (start < 1 || end < 1) { ! emsg(_(e_invalid_range)); return; } } *** ../vim-8.2.3068/src/typval.c 2021-06-15 22:54:25.179839176 +0200 --- src/typval.c 2021-06-27 21:45:22.295669111 +0200 *************** *** 1328,1334 **** : STR2NR_ALL, &n, NULL, 0, TRUE); if (len == 0) { ! semsg(_(e_invexpr2), *arg); return FAIL; } *arg += len; --- 1328,1334 ---- : STR2NR_ALL, &n, NULL, 0, TRUE); if (len == 0) { ! semsg(_(e_invalid_expression_str), *arg); return FAIL; } *arg += len; *** ../vim-8.2.3068/src/undo.c 2021-06-20 14:01:25.988924596 +0200 --- src/undo.c 2021-06-27 21:57:40.386333712 +0200 *************** *** 316,322 **** // Don't allow changes when 'modifiable' is off. if (!curbuf->b_p_ma) { ! emsg(_(e_modifiable)); return FALSE; } --- 316,322 ---- // Don't allow changes when 'modifiable' is off. if (!curbuf->b_p_ma) { ! emsg(_(e_cannot_make_changes_modifiable_is_off)); return FALSE; } *** ../vim-8.2.3068/src/userfunc.c 2021-06-26 22:22:35.770430468 +0200 --- src/userfunc.c 2021-06-27 21:48:10.763355959 +0200 *************** *** 4864,4870 **** { // If the function deleted lines or switched to another buffer // the line number may become invalid. ! emsg(_(e_invrange)); break; } curwin->w_cursor.lnum = lnum; --- 4864,4870 ---- { // If the function deleted lines or switched to another buffer // the line number may become invalid. ! emsg(_(e_invalid_range)); break; } curwin->w_cursor.lnum = lnum; *** ../vim-8.2.3068/src/vim9compile.c 2021-06-27 16:29:50.119042807 +0200 --- src/vim9compile.c 2021-06-27 21:52:03.394921645 +0200 *************** *** 4991,4997 **** } if (type_is && (p[len] == '?' || p[len] == '#')) { ! semsg(_(e_invexpr2), *arg); return FAIL; } // extra question mark appended: ignore case --- 4991,4997 ---- } if (type_is && (p[len] == '?' || p[len] == '#')) { ! semsg(_(e_invalid_expression_str), *arg); return FAIL; } // extra question mark appended: ignore case *************** *** 5821,5827 **** if (p == NULL) { // cannot happen? ! emsg(_(e_letunexp)); return FAIL; } cc = *p; --- 5821,5827 ---- if (p == NULL) { // cannot happen? ! emsg(_(e_unexpected_characters_in_assignment)); return FAIL; } cc = *p; *** ../vim-8.2.3068/src/window.c 2021-03-24 20:08:08.540745895 +0100 --- src/window.c 2021-06-27 21:59:26.146145147 +0200 *************** *** 130,136 **** do { \ if (cmdwin_type != 0) \ { \ ! emsg(_(e_cmdwin)); \ return; \ } \ } while (0) --- 130,136 ---- do { \ if (cmdwin_type != 0) \ { \ ! emsg(_(e_invalid_in_cmdline_window)); \ return; \ } \ } while (0) *************** *** 187,193 **** ? curwin->w_alt_fnum : Prenum) == NULL) { if (Prenum == 0) ! emsg(_(e_noalt)); else semsg(_("E92: Buffer %ld not found"), Prenum); break; --- 187,193 ---- ? curwin->w_alt_fnum : Prenum) == NULL) { if (Prenum == 0) ! emsg(_(e_no_alternate_file)); else semsg(_("E92: Buffer %ld not found"), Prenum); break; *** ../vim-8.2.3068/src/version.c 2021-06-27 21:29:49.989346334 +0200 --- src/version.c 2021-06-27 22:02:46.417784313 +0200 *************** *** 757,758 **** --- 757,760 ---- { /* Add new patch number below this line */ + /**/ + 3069, /**/ -- Don't believe everything you hear or anything you say. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///