patch 8.2.1482: Vim9: crash when using a nested lambda
Problem: Vim9: crash when using a nested lambda.
Solution: Do not clear the growarray when not evaluating. Correct pointer
when getting the next line. (closes #6731)
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim
index db899ee..2c88efb 100644
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -1624,6 +1624,15 @@
assert_equal(12, v)
END
CheckScriptSuccess(lines)
+
+ # nested lambda with line breaks
+ lines =<< trim END
+ vim9script
+ search('"', 'cW', 0, 0, {->
+ synstack('.', col('.'))
+ ->map({_, v -> synIDattr(v, 'name')})->len()})
+ END
+ CheckScriptSuccess(lines)
enddef
def Test_expr7_dict()