mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.3924: Vim9: no error if something follows :enddef
Problem: Vim9: no error if something follows :enddef in a nested function. Solution: Give an error. Move common code to a function.
This commit is contained in:
@@ -879,12 +879,18 @@ compile_nested_function(exarg_T *eap, cctx_T *cctx, char_u **line_to_free)
|
||||
}
|
||||
|
||||
ufunc = define_function(eap, lambda_name, line_to_free);
|
||||
|
||||
if (ufunc == NULL)
|
||||
{
|
||||
r = eap->skip ? OK : FAIL;
|
||||
goto theend;
|
||||
}
|
||||
if (eap->nextcmd != NULL)
|
||||
{
|
||||
semsg(_(e_text_found_after_str_str),
|
||||
eap->cmdidx == CMD_def ? "enddef" : "endfunction", eap->nextcmd);
|
||||
r = FAIL;
|
||||
goto theend;
|
||||
}
|
||||
|
||||
// copy over the block scope IDs before compiling
|
||||
if (!is_global && cctx->ctx_ufunc->uf_block_depth > 0)
|
||||
|
Reference in New Issue
Block a user