Patch 8.2.3235

4 views
Skip to first unread message

Bram Moolenaar

unread,
Jul 28, 2021, 9:55:34 AM7/28/21
to vim...@googlegroups.com

Patch 8.2.3235
Problem: Cannot use lambda in {} block in user command. (Martin Tournoij)
Solution: Do not go over the end of the lambda.
Files: src/userfunc.c, src/testdir/test_usercommands.vim


*** ../vim-8.2.3234/src/userfunc.c 2021-07-25 14:13:50.040566339 +0200
--- src/userfunc.c 2021-07-28 15:49:12.904894644 +0200
***************
*** 1398,1404 ****

// If there are line breaks, we need to split up the string.
line_end = vim_strchr(start, '\n');
! if (line_end == NULL)
line_end = end;

// Add "return " before the expression (or the first line).
--- 1398,1404 ----

// If there are line breaks, we need to split up the string.
line_end = vim_strchr(start, '\n');
! if (line_end == NULL || line_end > end)
line_end = end;

// Add "return " before the expression (or the first line).
*** ../vim-8.2.3234/src/testdir/test_usercommands.vim 2021-07-27 21:17:28.483675842 +0200
--- src/testdir/test_usercommands.vim 2021-07-28 15:52:38.932388588 +0200
***************
*** 632,637 ****
--- 632,644 ----
call assert_equal('more', g:didmore)
unlet g:didit
unlet g:didmore
+ delcommand DoSomething
+
+ command DoMap {
+ echo [1, 2, 3]->map((_, v) => v + 1)
+ }
+ DoMap
+ delcommand DoMap

let lines =<< trim END
command DoesNotEnd {
*** ../vim-8.2.3234/src/version.c 2021-07-28 15:06:57.791381469 +0200
--- src/version.c 2021-07-28 15:53:29.036265695 +0200
***************
*** 757,758 ****
--- 757,760 ----
{ /* Add new patch number below this line */
+ /**/
+ 3235,
/**/

--
XML is a nice language for computers. Not for humans.

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