0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

patch 8.2.2506: Vim9: :continue does not work correctly in a :try block

Problem:    Vim9: :continue does not work correctly in a :try block
Solution:   Add the TRYCLEANUP instruction. (closes #7827)
This commit is contained in:
Bram Moolenaar
2021-02-13 15:02:46 +01:00
parent 31842cd077
commit c150c09ec4
6 changed files with 190 additions and 19 deletions

View File

@@ -2201,6 +2201,23 @@ def Test_for_loop_unpack()
CheckDefExecFailure(lines, 'E1017:', 1)
enddef
def Test_for_loop_with_try_continue()
var looped = 0
var cleanup = 0
for i in range(3)
looped += 1
try
eval [][0]
catch
continue
finally
cleanup += 1
endtry
endfor
assert_equal(3, looped)
assert_equal(3, cleanup)
enddef
def Test_while_loop()
var result = ''
var cnt = 0