Patch 8.2.3146

3 views
Skip to first unread message

Bram Moolenaar

unread,
Jul 11, 2021, 10:53:23 AM7/11/21
to vim...@googlegroups.com

Patch 8.2.3146
Problem: Vim9: line number wrong for :execute argument.
Solution: Use the line number of the :execute command itself. (closes #8537)
Files: src/eval.c, src/testdir/test_vim9_script.vim


*** ../vim-8.2.3145/src/eval.c 2021-07-11 16:01:54.468064058 +0200
--- src/eval.c 2021-07-11 16:52:31.679586576 +0200
***************
*** 6191,6196 ****
--- 6191,6197 ----
char_u *p;
garray_T ga;
int len;
+ long start_lnum = SOURCING_LNUM;

ga_init2(&ga, 1, 80);

***************
*** 6244,6249 ****
--- 6245,6253 ----

if (ret != FAIL && ga.ga_data != NULL)
{
+ // use the first line of continuation lines for messages
+ SOURCING_LNUM = start_lnum;
+
if (eap->cmdidx == CMD_echomsg || eap->cmdidx == CMD_echoerr)
{
// Mark the already saved text as finishing the line, so that what
*** ../vim-8.2.3145/src/testdir/test_vim9_script.vim 2021-07-11 16:31:46.889430447 +0200
--- src/testdir/test_vim9_script.vim 2021-07-11 16:41:04.292603949 +0200
***************
*** 4167,4172 ****
--- 4167,4182 ----
set hlsearch&
enddef

+ " This must be called last, it may cause following :def functions to fail
+ def Test_xxx_echoerr_line_number()
+ var lines =<< trim END
+ echoerr 'some'
+ .. ' error'
+ .. ' continued'
+ END
+ CheckDefExecAndScriptFailure(lines, 'some error continued', 1)
+ enddef
+
def ProfiledFunc()
var n = 3
echo [[1, 2], [3, 4]]->filter((_, l) => l[0] == n)
*** ../vim-8.2.3145/src/version.c 2021-07-11 16:31:46.889430447 +0200
--- src/version.c 2021-07-11 16:51:52.371644767 +0200
***************
*** 757,758 ****
--- 757,760 ----
{ /* Add new patch number below this line */
+ /**/
+ 3146,
/**/

--
hundred-and-one symptoms of being an internet addict:
117. You are more comfortable typing in html.

/// 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