diff src/testdir/test_vim9_script.vim @ 19999:844c7646f61b v8.2.0555

patch 8.2.0555: Vim9: line continuation is not always needed Commit: https://github.com/vim/vim/commit/4fdae9996fb9a9bc1291a61e7b85cb360feb7599 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 12 16:38:57 2020 +0200 patch 8.2.0555: Vim9: line continuation is not always needed Problem: Vim9: line continuation is not always needed. Solution: Recognize continuation lines automatically in list and dict.
author Bram Moolenaar <Bram@vim.org>
date Sun, 12 Apr 2020 16:45:03 +0200
parents 12fa79cac39b
children 628011800942
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -966,6 +966,30 @@ def Test_interrupt_loop()
   assert_true(caught, 'should have caught an exception')
 enddef
 
+def Test_automatic_line_continuation()
+  let mylist = [
+      'one',
+      'two',
+      'three',
+      ] " comment
+  assert_equal(['one', 'two', 'three'], mylist)
+
+  let mydict = {
+      'one': 1,
+      'two': 2,
+      'three':
+          3,
+      } " comment
+  assert_equal({'one': 1, 'two': 2, 'three': 3}, mydict)
+  mydict = #{
+      one: 1,  " comment
+      two:
+           2,
+      three: 3  " comment
+      }
+  assert_equal(#{one: 1, two: 2, three: 3}, mydict)
+enddef
+
 " Keep this last, it messes up highlighting.
 def Test_substitute_cmd()
   new