0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

patch 8.2.1278: Vim9: line break after "->" only allowed in :def function

Problem:    Vim9: line break after "->" only allowed in :def function.
Solution:   Only allow line break after "->". (closes #6492)
This commit is contained in:
Bram Moolenaar
2020-07-23 15:38:03 +02:00
parent 7a87b4e3fe
commit dd1a9af00f
4 changed files with 16 additions and 6 deletions

View File

@@ -1460,7 +1460,8 @@ enddef
def Test_expr7_call()
assert_equal('yes', 'yes'->Echo())
assert_equal('yes', 'yes'->s:EchoArg())
assert_equal('yes', 'yes'
->s:EchoArg())
assert_equal(1, !range(5)->empty())
assert_equal([0, 1, 2], --3->range())
@@ -1531,6 +1532,8 @@ func Test_expr7_fails()
call CheckDefFailure(["let x = ''", "let y = x.memb"], 'E715:')
call CheckDefFailure(["'yes'->", "Echo()"], 'E488:')
call CheckDefExecFailure(["[1, 2->len()"], 'E697:')
call CheckDefExecFailure(["#{a: 1->len()"], 'E488:')
call CheckDefExecFailure(["{'a': 1->len()"], 'E723:')
@@ -1591,8 +1594,8 @@ enddef
def Test_expr7_subscript_linebreak()
let range = range(
3)
let l = range->
map('string(v:key)')
let l = range
->map('string(v:key)')
assert_equal(['0', '1', '2'], l)
l = range