0
0
mirror of https://github.com/vim/vim.git synced 2025-10-01 04:54:07 -04:00

patch 8.2.3051: Vim9: for loop with one list variable does not work

Problem:    Vim9: for loop with one list variable does not work.
Solution:   Use a separate flag for unpacking a list. (closes #8452)
This commit is contained in:
Bram Moolenaar
2021-06-26 12:40:56 +02:00
parent f3caeb63d6
commit 444d878324
3 changed files with 16 additions and 4 deletions

View File

@@ -2385,6 +2385,13 @@ def Test_for_loop()
endfor
assert_equal('1a2b', res)
# unpack with one var
var reslist = []
for [x] in [['aaa'], ['bbb']]
reslist->add(x)
endfor
assert_equal(['aaa', 'bbb'], reslist)
# loop over string
res = ''
for c in 'aéc̀d'