1
0
forked from aniani/vim

patch 8.2.2753: Vim9: cannot ignore an item in assignment unpack

Problem:    Vim9: cannot ignore an item in assignment unpack.
Solution:   Allow using an underscore.
This commit is contained in:
Bram Moolenaar
2021-04-10 22:35:43 +02:00
parent e8e3078184
commit f93bbd0262
7 changed files with 46 additions and 22 deletions

View File

@@ -256,6 +256,14 @@ def Test_assign_unpack()
[v1, v2] = [1, 2]
assert_equal(1, v1)
assert_equal(2, v2)
[v1, _, v2, _] = [1, 99, 2, 77]
assert_equal(1, v1)
assert_equal(2, v2)
[v1, v2; _] = [1, 2, 3, 4, 5]
assert_equal(1, v1)
assert_equal(2, v2)
END
CheckDefAndScriptSuccess(lines)