Patch 8.2.4888

4 views
Skip to first unread message

Bram Moolenaar

unread,
May 6, 2022, 10:47:41 AM5/6/22
to vim...@googlegroups.com

Patch 8.2.4888
Problem: Line number of lambda ignores line continuation.
Solution: Use the line number of where the arguments are. Avoid outputting
"..." twice. (closes #10364)
Files: src/userfunc.c


*** ../vim-8.2.4887/src/userfunc.c 2022-04-18 15:21:13.344896813 +0100
--- src/userfunc.c 2022-05-06 15:40:46.966492677 +0100
***************
*** 1373,1378 ****
--- 1373,1379 ----
int white_error = FALSE;
int called_emsg_start = called_emsg;
int vim9script = in_vim9script();
+ long start_lnum = SOURCING_LNUM;

if (equal_arrow && !vim9script)
return NOTDONE;
***************
*** 1433,1438 ****
--- 1434,1440 ----
if (evalarg == NULL)
// cannot happen?
goto theend;
+ SOURCING_LNUM = start_lnum; // used for where lambda is defined
if (lambda_function_body(arg, rettv, evalarg, pnewargs,
types_optional ? &argtypes : NULL, varargs,
&default_args, ret_type) == FAIL)
***************
*** 1563,1569 ****
fp->uf_flags = flags;
fp->uf_calls = 0;
fp->uf_script_ctx = current_sctx;
! fp->uf_script_ctx.sc_lnum += SOURCING_LNUM - newlines.ga_len + 1;

function_using_block_scopes(fp, evalarg->eval_cstack);

--- 1565,1572 ----
fp->uf_flags = flags;
fp->uf_calls = 0;
fp->uf_script_ctx = current_sctx;
! // Use the line number of the arguments.
! fp->uf_script_ctx.sc_lnum += start_lnum;

function_using_block_scopes(fp, evalarg->eval_cstack);

***************
*** 3707,3715 ****
}
if (fp->uf_va_name != NULL)
{
! if (j)
! msg_puts(", ");
! msg_puts("...");
msg_puts((char *)fp->uf_va_name);
if (fp->uf_va_type != NULL)
{
--- 3710,3721 ----
}
if (fp->uf_va_name != NULL)
{
! if (!fp->uf_varargs)
! {
! if (j)
! msg_puts(", ");
! msg_puts("...");
! }
msg_puts((char *)fp->uf_va_name);
if (fp->uf_va_type != NULL)
{
*** ../vim-8.2.4887/src/version.c 2022-05-06 14:58:59.534859061 +0100
--- src/version.c 2022-05-06 15:25:55.242652078 +0100
***************
*** 748,749 ****
--- 748,751 ----
{ /* Add new patch number below this line */
+ /**/
+ 4888,
/**/

--
hundred-and-one symptoms of being an internet addict:
116. You are living with your boyfriend who networks your respective
computers so you can sit in separate rooms and email each other

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages