mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.2642: Vim9: no clear error for wrong inline function
Problem: Vim9: no clear error for wrong inline function. Solution: Check for something following the "{".
This commit is contained in:
@@ -1963,6 +1963,11 @@ def Test_expr7_lambda_block()
|
|||||||
assert_equal(['no', 'yes', 'no'], dll)
|
assert_equal(['no', 'yes', 'no'], dll)
|
||||||
END
|
END
|
||||||
CheckDefAndScriptSuccess(lines)
|
CheckDefAndScriptSuccess(lines)
|
||||||
|
|
||||||
|
lines =<< trim END
|
||||||
|
map([1, 2], (k, v) => { redrawt })
|
||||||
|
END
|
||||||
|
CheckDefAndScriptFailure(lines, 'E488')
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
def NewLambdaWithComments(): func
|
def NewLambdaWithComments(): func
|
||||||
|
@@ -954,10 +954,15 @@ lambda_function_body(
|
|||||||
int lnum_save = -1;
|
int lnum_save = -1;
|
||||||
linenr_T sourcing_lnum_top = SOURCING_LNUM;
|
linenr_T sourcing_lnum_top = SOURCING_LNUM;
|
||||||
|
|
||||||
|
if (!ends_excmd2(*arg, skipwhite(*arg + 1)))
|
||||||
|
{
|
||||||
|
semsg(_(e_trailing_arg), *arg + 1);
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
CLEAR_FIELD(eap);
|
CLEAR_FIELD(eap);
|
||||||
eap.cmdidx = CMD_block;
|
eap.cmdidx = CMD_block;
|
||||||
eap.forceit = FALSE;
|
eap.forceit = FALSE;
|
||||||
eap.arg = *arg + 1;
|
|
||||||
eap.cmdlinep = &cmdline;
|
eap.cmdlinep = &cmdline;
|
||||||
eap.skip = !evaluate;
|
eap.skip = !evaluate;
|
||||||
if (evalarg->eval_cctx != NULL)
|
if (evalarg->eval_cctx != NULL)
|
||||||
|
@@ -750,6 +750,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 */
|
||||||
|
/**/
|
||||||
|
2642,
|
||||||
/**/
|
/**/
|
||||||
2641,
|
2641,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user