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