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.
2d06bfde29
This commit is contained in:
zeertzjq
2022-08-07 14:09:32 +08:00
parent d0686540f5
commit 48051ed62c
12 changed files with 24 additions and 24 deletions

View File

@@ -544,9 +544,9 @@ int var_redir_start(char *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();
@@ -1326,7 +1326,7 @@ char *get_lval(char *const name, typval_T *const rettv, lval_T *const lp, const
// Don't expand the name when we already know there is an error.
if (unlet && !ascii_iswhite(*p) && !ends_excmd(*p)
&& *p != '[' && *p != '.') {
emsg(_(e_trailing));
semsg(_(e_trailing_arg), p);
return NULL;
}