summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-07-23 17:16:18 +0200
committerBram Moolenaar <Bram@vim.org>2020-07-23 17:16:18 +0200
commit2d06bfde29bd3a62fc85823d2aa719ef943bd319 (patch)
treedac4bc628fbc1b9414f8901375abe0b9e975a736
parent8930caaa1a283092aca81fdbc3fcf15c7eadb197 (diff)
downloadvim-git-2d06bfde29bd3a62fc85823d2aa719ef943bd319.tar.gz
patch 8.2.1281: the "trailing characters" error can be hard to understandv8.2.1281
Problem: The "trailing characters" error can be hard to understand. Solution: Add the trailing characters to the message.
-rw-r--r--src/cmdhist.c4
-rw-r--r--src/eval.c2
-rw-r--r--src/evalfunc.c4
-rw-r--r--src/evalvars.c10
-rw-r--r--src/ex_cmds.c2
-rw-r--r--src/ex_docmd.c4
-rw-r--r--src/ex_eval.c2
-rw-r--r--src/json.c2
-rw-r--r--src/menu.c2
-rw-r--r--src/quickfix.c2
-rw-r--r--src/sign.c2
-rw-r--r--src/userfunc.c8
-rw-r--r--src/version.c2
13 files changed, 24 insertions, 22 deletions
diff --git a/src/cmdhist.c b/src/cmdhist.c
index d708535ff..69c83c0b5 100644
--- a/src/cmdhist.c
+++ b/src/cmdhist.c
@@ -705,7 +705,7 @@ ex_history(exarg_T *eap)
else
{
*end = i;
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), arg);
return;
}
}
@@ -717,7 +717,7 @@ ex_history(exarg_T *eap)
end = arg;
if (!get_list_range(&end, &hisidx1, &hisidx2) || *end != NUL)
{
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), end);
return;
}
diff --git a/src/eval.c b/src/eval.c
index bb75528ca..6d3d19ee8 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -797,7 +797,7 @@ get_lval(
if (unlet && !VIM_ISWHITE(*p) && !ends_excmd(*p)
&& *p != '[' && *p != '.')
{
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), p);
return NULL;
}
diff --git a/src/evalfunc.c b/src/evalfunc.c
index c07b1ab77..a631fd9c8 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -2141,7 +2141,7 @@ f_eval(typval_T *argvars, typval_T *rettv)
rettv->vval.v_number = 0;
}
else if (*s != NUL)
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), s);
}
/*
@@ -5113,7 +5113,7 @@ f_islocked(typval_T *argvars, typval_T *rettv)
if (end != NULL && lv.ll_name != NULL)
{
if (*end != NUL)
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), end);
else
{
if (lv.ll_tv == NULL)
diff --git a/src/evalvars.c b/src/evalvars.c
index 564c65b8a..e11fdac41 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -592,7 +592,7 @@ heredoc_get(exarg_T *eap, char_u *cmd, int script_get)
p = skiptowhite(marker);
if (*skipwhite(p) != NUL && *skipwhite(p) != '"')
{
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), p);
return NULL;
}
*p = NUL;
@@ -1113,7 +1113,7 @@ list_arg_vars(exarg_T *eap, char_u *arg, int *first)
if (!VIM_ISWHITE(*arg) && !ends_excmd(*arg))
{
emsg_severe = TRUE;
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), arg);
break;
}
}
@@ -1489,7 +1489,7 @@ ex_unletlock(
if (name_end != NULL)
{
emsg_severe = TRUE;
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), name_end);
}
if (!(eap->skip || error))
clear_lval(&lv);
@@ -3431,9 +3431,9 @@ var_redir_start(char_u *name, int append)
clear_lval(redir_lval);
if (redir_endp != NULL && *redir_endp != NUL)
// Trailing characters are present after the variable name
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), redir_endp);
else
- emsg(_(e_invarg));
+ semsg(_(e_invarg2), name);
redir_endp = NULL; // don't store a value, only cleanup
var_redir_stop();
return FAIL;
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 59c562b91..e8e38aa97 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3816,7 +3816,7 @@ do_sub(exarg_T *eap)
eap->nextcmd = check_nextcmd(cmd);
if (eap->nextcmd == NULL)
{
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), cmd);
return;
}
}
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 4f27898a1..bd3de8ff8 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2396,7 +2396,7 @@ do_one_cmd(
&& *ea.arg != '"' && (*ea.arg != '|' || (ea.argt & EX_TRLBAR) == 0))
{
// no arguments allowed but there is something
- errormsg = _(e_trailing);
+ errormsg = ex_errmsg(e_trailing_arg, ea.arg);
goto doend;
}
@@ -7725,7 +7725,7 @@ ex_mark(exarg_T *eap)
if (*eap->arg == NUL) // No argument?
emsg(_(e_argreq));
else if (eap->arg[1] != NUL) // more than one character?
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), eap->arg);
else
{
pos = curwin->w_cursor; // save curwin->w_cursor
diff --git a/src/ex_eval.c b/src/ex_eval.c
index 3fdc208df..f0ffaffdd 100644
--- a/src/ex_eval.c
+++ b/src/ex_eval.c
@@ -1588,7 +1588,7 @@ ex_catch(exarg_T *eap)
if (end != NULL && *end != NUL
&& !ends_excmd2(end, skipwhite(end + 1)))
{
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), end);
return;
}
diff --git a/src/json.c b/src/json.c
index c22864df1..8262640db 100644
--- a/src/json.c
+++ b/src/json.c
@@ -1086,7 +1086,7 @@ json_decode_all(js_read_T *reader, typval_T *res, int options)
json_skip_white(reader);
if (reader->js_buf[reader->js_used] != NUL)
{
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), reader->js_buf + reader->js_used);
return FAIL;
}
return OK;
diff --git a/src/menu.c b/src/menu.c
index 8a69edd1a..fd811de06 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -289,7 +289,7 @@ ex_menu(
}
else if (*map_to != NUL && (unmenu || enable != MAYBE))
{
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), map_to);
goto theend;
}
#if defined(FEAT_GUI) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON))
diff --git a/src/quickfix.c b/src/quickfix.c
index 4957f7d52..1901e3806 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -3579,7 +3579,7 @@ qf_list(exarg_T *eap)
}
if (!get_list_range(&arg, &idx1, &idx2) || *arg != NUL)
{
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), arg);
return;
}
qfl = qf_get_curlist(qi);
diff --git a/src/sign.c b/src/sign.c
index a3dfaf034..fb452b30c 100644
--- a/src/sign.c
+++ b/src/sign.c
@@ -1577,7 +1577,7 @@ parse_sign_cmd_args(
filename = arg;
*buf = buflist_findnr((int)getdigits(&arg));
if (*skipwhite(arg) != NUL)
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), arg);
break;
}
else
diff --git a/src/userfunc.c b/src/userfunc.c
index 3967d2743..bf026d857 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -2664,7 +2664,7 @@ def_function(exarg_T *eap, char_u *name_arg)
{
if (!ends_excmd(*skipwhite(p)))
{
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), p);
goto ret_free;
}
eap->nextcmd = check_nextcmd(p);
@@ -2833,7 +2833,7 @@ def_function(exarg_T *eap, char_u *name_arg)
&& !(*p == '#' && (vim9script || eap->cmdidx == CMD_def))
&& !eap->skip
&& !did_emsg)
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), p);
/*
* Read the body of the function, until "}", ":endfunction" or ":enddef" is
@@ -3629,7 +3629,7 @@ ex_delfunction(exarg_T *eap)
if (!ends_excmd(*skipwhite(p)))
{
vim_free(name);
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), p);
return;
}
eap->nextcmd = check_nextcmd(p);
@@ -3977,7 +3977,7 @@ ex_call(exarg_T *eap)
if (!failed)
{
emsg_severe = TRUE;
- emsg(_(e_trailing));
+ semsg(_(e_trailing_arg), arg);
}
}
else
diff --git a/src/version.c b/src/version.c
index 064174659..4286eb0b3 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1281,
+/**/
1280,
/**/
1279,