mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.1421: Vim9: handling "+" and "-" before number differs from script
Problem: Vim9: handling "+" and "-" before number differs from Vim script. Solution: Use the same sequence of commands.
This commit is contained in:
@@ -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 */
|
||||||
|
/**/
|
||||||
|
1421,
|
||||||
/**/
|
/**/
|
||||||
1420,
|
1420,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -3206,6 +3206,15 @@ compile_expr7(
|
|||||||
case '9':
|
case '9':
|
||||||
case '.': if (eval_number(arg, rettv, TRUE, FALSE) == FAIL)
|
case '.': if (eval_number(arg, rettv, TRUE, FALSE) == FAIL)
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
// Apply "-" and "+" just before the number now, right to
|
||||||
|
// left. Matters especially when "->" follows. Stops at
|
||||||
|
// '!'.
|
||||||
|
if (apply_leader(rettv, TRUE,
|
||||||
|
start_leader, &end_leader) == FAIL)
|
||||||
|
{
|
||||||
|
clear_tv(rettv);
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -3344,13 +3353,6 @@ compile_expr7(
|
|||||||
|
|
||||||
if (rettv->v_type != VAR_UNKNOWN && used_before == ppconst->pp_used)
|
if (rettv->v_type != VAR_UNKNOWN && used_before == ppconst->pp_used)
|
||||||
{
|
{
|
||||||
// apply the '-' and '+' before the constant, but not '!'
|
|
||||||
if (apply_leader(rettv, TRUE, start_leader, &end_leader) == FAIL)
|
|
||||||
{
|
|
||||||
clear_tv(rettv);
|
|
||||||
return FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cctx->ctx_skip == SKIP_YES)
|
if (cctx->ctx_skip == SKIP_YES)
|
||||||
clear_tv(rettv);
|
clear_tv(rettv);
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user