0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

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.
This commit is contained in:
Bram Moolenaar
2020-06-21 14:12:17 +02:00
parent 8c524f76eb
commit a3b7fdc1bb
3 changed files with 30 additions and 4 deletions

View File

@@ -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')