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:
@@ -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')
|
||||
|
Reference in New Issue
Block a user