diff --git a/src/testdir/test_usercommands.vim b/src/testdir/test_usercommands.vim index df8893709..173b23ed2 100644 --- a/src/testdir/test_usercommands.vim +++ b/src/testdir/test_usercommands.vim @@ -632,6 +632,13 @@ func Test_usercmd_with_block() 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 { diff --git a/src/userfunc.c b/src/userfunc.c index 7c9634742..e00871883 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -1398,7 +1398,7 @@ get_lambda_tv( // If there are line breaks, we need to split up the string. line_end = vim_strchr(start, '\n'); - if (line_end == NULL) + if (line_end == NULL || line_end > end) line_end = end; // Add "return " before the expression (or the first line). diff --git a/src/version.c b/src/version.c index fa54081ca..ea232c37b 100644 --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 3235, /**/ 3234, /**/