forked from aniani/vim
patch 8.2.1281: the "trailing characters" error can be hard to understand
Problem: The "trailing characters" error can be hard to understand. Solution: Add the trailing characters to the message.
This commit is contained in:
parent
8930caaa1a
commit
2d06bfde29
@ -705,7 +705,7 @@ ex_history(exarg_T *eap)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
*end = i;
|
*end = i;
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), arg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -717,7 +717,7 @@ ex_history(exarg_T *eap)
|
|||||||
end = arg;
|
end = arg;
|
||||||
if (!get_list_range(&end, &hisidx1, &hisidx2) || *end != NUL)
|
if (!get_list_range(&end, &hisidx1, &hisidx2) || *end != NUL)
|
||||||
{
|
{
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), end);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -797,7 +797,7 @@ get_lval(
|
|||||||
if (unlet && !VIM_ISWHITE(*p) && !ends_excmd(*p)
|
if (unlet && !VIM_ISWHITE(*p) && !ends_excmd(*p)
|
||||||
&& *p != '[' && *p != '.')
|
&& *p != '[' && *p != '.')
|
||||||
{
|
{
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), p);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2141,7 +2141,7 @@ f_eval(typval_T *argvars, typval_T *rettv)
|
|||||||
rettv->vval.v_number = 0;
|
rettv->vval.v_number = 0;
|
||||||
}
|
}
|
||||||
else if (*s != NUL)
|
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 != NULL && lv.ll_name != NULL)
|
||||||
{
|
{
|
||||||
if (*end != NUL)
|
if (*end != NUL)
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), end);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (lv.ll_tv == NULL)
|
if (lv.ll_tv == NULL)
|
||||||
|
@ -592,7 +592,7 @@ heredoc_get(exarg_T *eap, char_u *cmd, int script_get)
|
|||||||
p = skiptowhite(marker);
|
p = skiptowhite(marker);
|
||||||
if (*skipwhite(p) != NUL && *skipwhite(p) != '"')
|
if (*skipwhite(p) != NUL && *skipwhite(p) != '"')
|
||||||
{
|
{
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), p);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
*p = NUL;
|
*p = NUL;
|
||||||
@ -1113,7 +1113,7 @@ list_arg_vars(exarg_T *eap, char_u *arg, int *first)
|
|||||||
if (!VIM_ISWHITE(*arg) && !ends_excmd(*arg))
|
if (!VIM_ISWHITE(*arg) && !ends_excmd(*arg))
|
||||||
{
|
{
|
||||||
emsg_severe = TRUE;
|
emsg_severe = TRUE;
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), arg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1489,7 +1489,7 @@ ex_unletlock(
|
|||||||
if (name_end != NULL)
|
if (name_end != NULL)
|
||||||
{
|
{
|
||||||
emsg_severe = TRUE;
|
emsg_severe = TRUE;
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), name_end);
|
||||||
}
|
}
|
||||||
if (!(eap->skip || error))
|
if (!(eap->skip || error))
|
||||||
clear_lval(&lv);
|
clear_lval(&lv);
|
||||||
@ -3431,9 +3431,9 @@ var_redir_start(char_u *name, int append)
|
|||||||
clear_lval(redir_lval);
|
clear_lval(redir_lval);
|
||||||
if (redir_endp != NULL && *redir_endp != NUL)
|
if (redir_endp != NULL && *redir_endp != NUL)
|
||||||
// Trailing characters are present after the variable name
|
// Trailing characters are present after the variable name
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), redir_endp);
|
||||||
else
|
else
|
||||||
emsg(_(e_invarg));
|
semsg(_(e_invarg2), name);
|
||||||
redir_endp = NULL; // don't store a value, only cleanup
|
redir_endp = NULL; // don't store a value, only cleanup
|
||||||
var_redir_stop();
|
var_redir_stop();
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
@ -3816,7 +3816,7 @@ do_sub(exarg_T *eap)
|
|||||||
eap->nextcmd = check_nextcmd(cmd);
|
eap->nextcmd = check_nextcmd(cmd);
|
||||||
if (eap->nextcmd == NULL)
|
if (eap->nextcmd == NULL)
|
||||||
{
|
{
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), cmd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2396,7 +2396,7 @@ do_one_cmd(
|
|||||||
&& *ea.arg != '"' && (*ea.arg != '|' || (ea.argt & EX_TRLBAR) == 0))
|
&& *ea.arg != '"' && (*ea.arg != '|' || (ea.argt & EX_TRLBAR) == 0))
|
||||||
{
|
{
|
||||||
// no arguments allowed but there is something
|
// no arguments allowed but there is something
|
||||||
errormsg = _(e_trailing);
|
errormsg = ex_errmsg(e_trailing_arg, ea.arg);
|
||||||
goto doend;
|
goto doend;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7725,7 +7725,7 @@ ex_mark(exarg_T *eap)
|
|||||||
if (*eap->arg == NUL) // No argument?
|
if (*eap->arg == NUL) // No argument?
|
||||||
emsg(_(e_argreq));
|
emsg(_(e_argreq));
|
||||||
else if (eap->arg[1] != NUL) // more than one character?
|
else if (eap->arg[1] != NUL) // more than one character?
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), eap->arg);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pos = curwin->w_cursor; // save curwin->w_cursor
|
pos = curwin->w_cursor; // save curwin->w_cursor
|
||||||
|
@ -1588,7 +1588,7 @@ ex_catch(exarg_T *eap)
|
|||||||
if (end != NULL && *end != NUL
|
if (end != NULL && *end != NUL
|
||||||
&& !ends_excmd2(end, skipwhite(end + 1)))
|
&& !ends_excmd2(end, skipwhite(end + 1)))
|
||||||
{
|
{
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), end);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1086,7 +1086,7 @@ json_decode_all(js_read_T *reader, typval_T *res, int options)
|
|||||||
json_skip_white(reader);
|
json_skip_white(reader);
|
||||||
if (reader->js_buf[reader->js_used] != NUL)
|
if (reader->js_buf[reader->js_used] != NUL)
|
||||||
{
|
{
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), reader->js_buf + reader->js_used);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
return OK;
|
return OK;
|
||||||
|
@ -289,7 +289,7 @@ ex_menu(
|
|||||||
}
|
}
|
||||||
else if (*map_to != NUL && (unmenu || enable != MAYBE))
|
else if (*map_to != NUL && (unmenu || enable != MAYBE))
|
||||||
{
|
{
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), map_to);
|
||||||
goto theend;
|
goto theend;
|
||||||
}
|
}
|
||||||
#if defined(FEAT_GUI) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON))
|
#if defined(FEAT_GUI) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON))
|
||||||
|
@ -3579,7 +3579,7 @@ qf_list(exarg_T *eap)
|
|||||||
}
|
}
|
||||||
if (!get_list_range(&arg, &idx1, &idx2) || *arg != NUL)
|
if (!get_list_range(&arg, &idx1, &idx2) || *arg != NUL)
|
||||||
{
|
{
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), arg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
qfl = qf_get_curlist(qi);
|
qfl = qf_get_curlist(qi);
|
||||||
|
@ -1577,7 +1577,7 @@ parse_sign_cmd_args(
|
|||||||
filename = arg;
|
filename = arg;
|
||||||
*buf = buflist_findnr((int)getdigits(&arg));
|
*buf = buflist_findnr((int)getdigits(&arg));
|
||||||
if (*skipwhite(arg) != NUL)
|
if (*skipwhite(arg) != NUL)
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), arg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2664,7 +2664,7 @@ def_function(exarg_T *eap, char_u *name_arg)
|
|||||||
{
|
{
|
||||||
if (!ends_excmd(*skipwhite(p)))
|
if (!ends_excmd(*skipwhite(p)))
|
||||||
{
|
{
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), p);
|
||||||
goto ret_free;
|
goto ret_free;
|
||||||
}
|
}
|
||||||
eap->nextcmd = check_nextcmd(p);
|
eap->nextcmd = check_nextcmd(p);
|
||||||
@ -2833,7 +2833,7 @@ def_function(exarg_T *eap, char_u *name_arg)
|
|||||||
&& !(*p == '#' && (vim9script || eap->cmdidx == CMD_def))
|
&& !(*p == '#' && (vim9script || eap->cmdidx == CMD_def))
|
||||||
&& !eap->skip
|
&& !eap->skip
|
||||||
&& !did_emsg)
|
&& !did_emsg)
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), p);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read the body of the function, until "}", ":endfunction" or ":enddef" is
|
* 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)))
|
if (!ends_excmd(*skipwhite(p)))
|
||||||
{
|
{
|
||||||
vim_free(name);
|
vim_free(name);
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
eap->nextcmd = check_nextcmd(p);
|
eap->nextcmd = check_nextcmd(p);
|
||||||
@ -3977,7 +3977,7 @@ ex_call(exarg_T *eap)
|
|||||||
if (!failed)
|
if (!failed)
|
||||||
{
|
{
|
||||||
emsg_severe = TRUE;
|
emsg_severe = TRUE;
|
||||||
emsg(_(e_trailing));
|
semsg(_(e_trailing_arg), arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -754,6 +754,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 */
|
||||||
|
/**/
|
||||||
|
1281,
|
||||||
/**/
|
/**/
|
||||||
1280,
|
1280,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user