summaryrefslogtreecommitdiff
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-06-27 22:03:33 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-27 22:03:33 +0200
commit108010aa4720ef023a8ac59004fc0f2bc11125af (patch)
tree831741a42644a86ee0d74679361f74cc27861eaa /src/ex_docmd.c
parentd887297ad0164516dd52cdab0308c3626337d124 (diff)
downloadvim-git-108010aa4720ef023a8ac59004fc0f2bc11125af.tar.gz
patch 8.2.3069: error messages are spread outv8.2.3069
Problem: Error messages are spread out. Solution: Move some error messages to errors.h. Use clearer names.
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c57
1 files changed, 29 insertions, 28 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 027d139da..62d50b2d9 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1997,7 +1997,7 @@ do_one_cmd(
}
if (ea.line2 < 0)
- errormsg = _(e_invrange);
+ errormsg = _(e_invalid_range);
else
{
if (ea.line2 == 0)
@@ -2124,7 +2124,7 @@ do_one_cmd(
if (!curbuf->b_p_ma && (ea.argt & EX_MODIFY))
{
// Command not allowed in non-'modifiable' buffer
- errormsg = _(e_modifiable);
+ errormsg = _(e_cannot_make_changes_modifiable_is_off);
goto doend;
}
@@ -2134,7 +2134,7 @@ do_one_cmd(
if (cmdwin_type != 0 && !(ea.argt & EX_CMDWIN))
{
// Command not allowed in the command line window
- errormsg = _(e_cmdwin);
+ errormsg = _(e_invalid_in_cmdline_window);
goto doend;
}
#endif
@@ -2996,7 +2996,7 @@ parse_command_modifiers(
{
if (tabnr < 0 || tabnr > LAST_TAB_NR)
{
- *errormsg = _(e_invrange);
+ *errormsg = _(e_invalid_range);
return FAIL;
}
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
// ADDR_WINDOWS or ADDR_TABS
- *errormsg = _(e_invrange);
+ *errormsg = _(e_invalid_range);
return FAIL;
}
break;
case ADDR_TABS_RELATIVE:
case ADDR_UNSIGNED:
case ADDR_QUICKFIX:
- *errormsg = _(e_invrange);
+ *errormsg = _(e_invalid_range);
return FAIL;
case ADDR_ARGUMENTS:
if (ARGCOUNT == 0)
@@ -3278,7 +3278,7 @@ parse_cmd_address(exarg_T *eap, char **errormsg, int silent)
// '*' - visual area
if (eap->addr_type != ADDR_LINES)
{
- *errormsg = _(e_invrange);
+ *errormsg = _(e_invalid_range);
return FAIL;
}
@@ -3923,7 +3923,7 @@ addr_error(cmd_addr_T addr_type)
if (addr_type == ADDR_NONE)
emsg(_(e_norange));
else
- emsg(_(e_invrange));
+ emsg(_(e_invalid_range));
}
/*
@@ -4210,7 +4210,7 @@ get_address(
i = RE_SEARCH;
else
{
- emsg(_(e_backslash));
+ emsg(_(e_backslash_should_be_followed_by));
cmd = NULL;
goto error;
}
@@ -4312,7 +4312,7 @@ get_address(
if (addr_type == ADDR_TABS_RELATIVE)
{
- emsg(_(e_invrange));
+ emsg(_(e_invalid_range));
cmd = NULL;
goto error;
}
@@ -4460,7 +4460,7 @@ invalid_range(exarg_T *eap)
if ( eap->line1 < 0
|| eap->line2 < 0
|| eap->line1 > eap->line2)
- return _(e_invrange);
+ return _(e_invalid_range);
if (eap->argt & EX_RANGE)
{
@@ -4472,46 +4472,46 @@ invalid_range(exarg_T *eap)
+ (eap->cmdidx == CMD_diffget)
#endif
)
- return _(e_invrange);
+ return _(e_invalid_range);
break;
case ADDR_ARGUMENTS:
// add 1 if ARGCOUNT is 0
if (eap->line2 > ARGCOUNT + (!ARGCOUNT))
- return _(e_invrange);
+ 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_invrange);
+ 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_invrange);
+ return _(e_invalid_range);
buf = buf->b_next;
}
if (eap->line1 < buf->b_fnum)
- return _(e_invrange);
+ return _(e_invalid_range);
buf = lastbuf;
while (buf->b_ml.ml_mfp == NULL)
{
if (buf->b_prev == NULL)
- return _(e_invrange);
+ return _(e_invalid_range);
buf = buf->b_prev;
}
if (eap->line2 > buf->b_fnum)
- return _(e_invrange);
+ return _(e_invalid_range);
break;
case ADDR_WINDOWS:
if (eap->line2 > LAST_WIN_NR)
- return _(e_invrange);
+ return _(e_invalid_range);
break;
case ADDR_TABS:
if (eap->line2 > LAST_TAB_NR)
- return _(e_invrange);
+ return _(e_invalid_range);
break;
case ADDR_TABS_RELATIVE:
case ADDR_OTHER:
@@ -4521,14 +4521,14 @@ invalid_range(exarg_T *eap)
#ifdef FEAT_QUICKFIX
// No error for value that is too big, will use the last entry.
if (eap->line2 <= 0)
- return _(e_invrange);
+ 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_invrange);
+ return _(e_invalid_range);
#endif
break;
case ADDR_UNSIGNED:
@@ -5187,7 +5187,8 @@ ex_autocmd(exarg_T *eap)
if (secure)
{
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)
do_autocmd(eap->arg, eap->forceit);
@@ -5842,7 +5843,7 @@ get_tabpage_arg(exarg_T *eap)
{
if (unaccept_arg0 && eap->line2 == 0)
{
- eap->errmsg = _(e_invrange);
+ eap->errmsg = _(e_invalid_range);
tab_number = 0;
}
else
@@ -5852,7 +5853,7 @@ get_tabpage_arg(exarg_T *eap)
{
--tab_number;
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;
if (tab_number < 1)
{
- eap->errmsg = _(e_invrange);
+ eap->errmsg = _(e_invalid_range);
return;
}
}
@@ -7715,7 +7716,7 @@ ex_copymove(exarg_T *eap)
*/
if (n == MAXLNUM || n < 0 || n > curbuf->b_ml.ml_line_count)
{
- emsg(_(e_invrange));
+ emsg(_(e_invalid_range));
return;
}
@@ -8163,7 +8164,7 @@ open_exfile(
// with Unix it is possible to open a directory
if (mch_isdir(fname))
{
- semsg(_(e_isadir2), fname);
+ semsg(_(e_src_is_directory), fname);
return NULL;
}
#endif