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

patch 8.2.2816: Vim9: comment below expression in lambda causes problems

Problem:    Vim9: comment below expression in lambda causes problems.
Solution:   Use a single space for empty and comment lines. (closes #8156)
This commit is contained in:
Bram Moolenaar
2021-04-28 20:00:40 +02:00
parent b80d2fb0e7
commit 03717bf6a2
3 changed files with 23 additions and 3 deletions

View File

@@ -1887,6 +1887,7 @@ enddef
def Test_expr7_lambda()
var lines =<< trim END
var La = () => 'result'
# comment
assert_equal('result', La())
assert_equal([1, 3, 5], [1, 2, 3]->map((key, val) => key + val))
@@ -1897,6 +1898,12 @@ def Test_expr7_lambda()
)
assert_equal([{}, {111: 111}, {}], dll)
# comment halfway an expression
var Ref = () => 4
# comment
+ 6
assert_equal(10, Ref())
ll = range(3)
map(ll, (k, v) => v == 8 || v
== 9