patch 8.2.1029: Vim9: cannot chain function calls with -> at line start
Problem: Vim9: cannot chain function calls with -> at line start.
Solution: Peek ahead for a following line starting with "->". (closes #6306)
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim
index f87e920..b46e04b 100644
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -1036,6 +1036,24 @@
map('string(v:key)')
assert_equal(['0', '1', '2'], l)
+ l = range
+ ->map('string(v:key)')
+ assert_equal(['0', '1', '2'], l)
+
+ l = range # comment
+ ->map('string(v:key)')
+ assert_equal(['0', '1', '2'], l)
+
+ l = range
+
+ ->map('string(v:key)')
+ assert_equal(['0', '1', '2'], l)
+
+ l = range
+ # comment
+ ->map('string(v:key)')
+ assert_equal(['0', '1', '2'], l)
+
assert_equal('1', l[
1])