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

patch 8.2.2657: Vim9: error message for declaring variable in for loop

Problem:    Vim9: error message for declaring variable in for loop.
Solution:   Clear variables when entering block again. (closes #8012)
This commit is contained in:
Bram Moolenaar
2021-03-26 18:49:22 +01:00
parent a2b3e7dc92
commit 522eefd9a2
3 changed files with 40 additions and 7 deletions

View File

@@ -2263,6 +2263,13 @@ def Test_for_outside_of_function()
endfor
assert_equal(['', '0', '1', '2', '3'], getline(1, '$'))
bwipe!
var result = ''
for i in [1, 2, 3]
var loop = ' loop ' .. i
result ..= loop
endfor
assert_equal(' loop 1 loop 2 loop 3', result)
END
writefile(lines, 'Xvim9for.vim')
source Xvim9for.vim