diff src/testdir/test_vim9_expr.vim @ 20949:62912ad41aff v8.2.1026

patch 8.2.1026: Vim9: cannot break the line after "->" Commit: https://github.com/vim/vim/commit/a3b7fdc1bb227897f41b8f2958a48d0a26292ff7 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 21 14:12:17 2020 +0200 patch 8.2.1026: Vim9: cannot break the line after "->" Problem: Vim9: cannot break the line after "->". Solution: Check for a continuation line after "->", "[" and ".". Ignore trailing white space.
author Bram Moolenaar <Bram@vim.org>
date Sun, 21 Jun 2020 14:15:03 +0200
parents 96bf2b304932
children 6b4b887a12f0
line wrap: on
line diff
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -1029,6 +1029,21 @@ def Test_expr7_trailing()
   assert_equal(123, d.key)
 enddef
 
+def Test_expr7_subscript_linebreak()
+  let range = range(
+  		3)
+  let l = range->
+  	map('string(v:key)')
+  assert_equal(['0', '1', '2'], l)
+
+  assert_equal('1', l[
+	1])
+
+  let d = #{one: 33}
+  assert_equal(33, d.
+	one)
+enddef
+
 
 func Test_expr7_trailing_fails()
   call CheckDefFailure(['let l = [2]', 'l->{l -> add(l, 8)}'], 'E107')