1
0
forked from aniani/vim

patch 8.2.1080: Vim9: no line break allowed in a for loop

Problem:    Vim9: no line break allowed in a for loop.
Solution:   Skip line breaks in for command.
This commit is contained in:
Bram Moolenaar
2020-06-28 18:43:40 +02:00
parent d5053d015a
commit b7a78f7a67
8 changed files with 101 additions and 23 deletions

View File

@@ -160,4 +160,35 @@ def Test_while_linebreak()
CheckScriptSuccess(lines)
enddef
def Test_for_linebreak()
let lines =<< trim END
vim9script
let nr = 0
for x
in
[1, 2, 3, 4]
nr = nr + x
endfor
assert_equal(10, nr)
END
CheckScriptSuccess(lines)
lines =<< trim END
vim9script
let nr = 0
for x
in
[1, 2,
3, 4
]
nr = nr
+
x
endfor
assert_equal(10, nr)
END
CheckScriptSuccess(lines)
enddef
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker