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