forked from aniani/vim
patch 8.2.2486: Vim9: some errors for white space do not show context
Problem: Vim9: some errors for white space do not show context. Solution: Include the text at the error.
This commit is contained in:
parent
0123cc1e14
commit
ba98fb54ae
@ -945,7 +945,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
|
||||
if (**arg != ':')
|
||||
{
|
||||
if (*skipwhite(*arg) == ':')
|
||||
semsg(_(e_no_white_space_allowed_before_str), ":");
|
||||
semsg(_(e_no_white_space_allowed_before_str_str), ":", *arg);
|
||||
else
|
||||
semsg(_(e_missing_dict_colon), *arg);
|
||||
clear_tv(&tvkey);
|
||||
@ -1025,7 +1025,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
|
||||
if (!had_comma)
|
||||
{
|
||||
if (**arg == ',')
|
||||
semsg(_(e_no_white_space_allowed_before_str), ",");
|
||||
semsg(_(e_no_white_space_allowed_before_str_str), ",", *arg);
|
||||
else
|
||||
semsg(_(e_missing_dict_comma), *arg);
|
||||
goto failret;
|
||||
|
@ -173,8 +173,8 @@ EXTERN char e_cannot_declare_a_register_str[]
|
||||
INIT(= N_("E1066: Cannot declare a register: %s"));
|
||||
EXTERN char e_separator_mismatch_str[]
|
||||
INIT(= N_("E1067: Separator mismatch: %s"));
|
||||
EXTERN char e_no_white_space_allowed_before_str[]
|
||||
INIT(= N_("E1068: No white space allowed before '%s'"));
|
||||
EXTERN char e_no_white_space_allowed_before_str_str[]
|
||||
INIT(= N_("E1068: No white space allowed before '%s': %s"));
|
||||
EXTERN char e_white_space_required_after_str_str[]
|
||||
INIT(= N_("E1069: White space required after '%s': %s"));
|
||||
EXTERN char e_missing_from[]
|
||||
|
@ -1328,7 +1328,8 @@ eval_list(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int do_error)
|
||||
if (do_error)
|
||||
{
|
||||
if (**arg == ',')
|
||||
semsg(_(e_no_white_space_allowed_before_str), ",");
|
||||
semsg(_(e_no_white_space_allowed_before_str_str),
|
||||
",", *arg);
|
||||
else
|
||||
semsg(_("E696: Missing comma in List: %s"), *arg);
|
||||
}
|
||||
|
@ -878,7 +878,7 @@ get_func_tv(
|
||||
{
|
||||
if (*argp != ',' && *skipwhite(argp) == ',')
|
||||
{
|
||||
semsg(_(e_no_white_space_allowed_before_str), ",");
|
||||
semsg(_(e_no_white_space_allowed_before_str_str), ",", argp);
|
||||
ret = FAIL;
|
||||
break;
|
||||
}
|
||||
@ -3214,7 +3214,7 @@ define_function(exarg_T *eap, char_u *name_arg)
|
||||
|
||||
if ((vim9script || eap->cmdidx == CMD_def) && VIM_ISWHITE(p[-1]))
|
||||
{
|
||||
semsg(_(e_no_white_space_allowed_before_str), "(");
|
||||
semsg(_(e_no_white_space_allowed_before_str_str), "(", p - 1);
|
||||
goto ret_free;
|
||||
}
|
||||
|
||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2486,
|
||||
/**/
|
||||
2485,
|
||||
/**/
|
||||
|
@ -2800,7 +2800,7 @@ compile_arguments(char_u **arg, cctx_T *cctx, int *argcount)
|
||||
|
||||
if (*p != ',' && *skipwhite(p) == ',')
|
||||
{
|
||||
semsg(_(e_no_white_space_allowed_before_str), ",");
|
||||
semsg(_(e_no_white_space_allowed_before_str_str), ",", p);
|
||||
p = skipwhite(p);
|
||||
}
|
||||
if (*p == ',')
|
||||
@ -3055,7 +3055,7 @@ compile_list(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
|
||||
}
|
||||
if (*p == ',')
|
||||
{
|
||||
semsg(_(e_no_white_space_allowed_before_str), ",");
|
||||
semsg(_(e_no_white_space_allowed_before_str_str), ",", p);
|
||||
return FAIL;
|
||||
}
|
||||
if (*p == ']')
|
||||
@ -3234,7 +3234,7 @@ compile_dict(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
|
||||
if (**arg != ':')
|
||||
{
|
||||
if (*skipwhite(*arg) == ':')
|
||||
semsg(_(e_no_white_space_allowed_before_str), ":");
|
||||
semsg(_(e_no_white_space_allowed_before_str_str), ":", *arg);
|
||||
else
|
||||
semsg(_(e_missing_dict_colon), *arg);
|
||||
return FAIL;
|
||||
@ -3273,7 +3273,7 @@ compile_dict(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
|
||||
}
|
||||
if (IS_WHITE_OR_NUL(*whitep))
|
||||
{
|
||||
semsg(_(e_no_white_space_allowed_before_str), ",");
|
||||
semsg(_(e_no_white_space_allowed_before_str_str), ",", whitep);
|
||||
return FAIL;
|
||||
}
|
||||
whitep = *arg + 1;
|
||||
@ -4270,7 +4270,7 @@ compile_expr7t(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
|
||||
if (**arg != '>')
|
||||
{
|
||||
if (*skipwhite(*arg) == '>')
|
||||
semsg(_(e_no_white_space_allowed_before_str), ">");
|
||||
semsg(_(e_no_white_space_allowed_before_str_str), ">", *arg);
|
||||
else
|
||||
emsg(_(e_missing_gt));
|
||||
return FAIL;
|
||||
|
@ -638,7 +638,7 @@ parse_type_member(
|
||||
if (give_error)
|
||||
{
|
||||
if (*skipwhite(*arg) == '<')
|
||||
semsg(_(e_no_white_space_allowed_before_str), "<");
|
||||
semsg(_(e_no_white_space_allowed_before_str_str), "<", *arg);
|
||||
else
|
||||
emsg(_(e_missing_type));
|
||||
}
|
||||
@ -779,7 +779,8 @@ parse_type(char_u **arg, garray_T *type_gap, int give_error)
|
||||
if (*p != ',' && *skipwhite(p) == ',')
|
||||
{
|
||||
if (give_error)
|
||||
semsg(_(e_no_white_space_allowed_before_str), ",");
|
||||
semsg(_(e_no_white_space_allowed_before_str_str),
|
||||
",", p);
|
||||
return NULL;
|
||||
}
|
||||
if (*p == ',')
|
||||
|
Loading…
x
Reference in New Issue
Block a user