Mercurial > vim
diff src/testdir/test_vim9_script.vim @ 23927:5e5780e3f75d v8.2.2506
patch 8.2.2506: Vim9: :continue does not work correctly in a :try block
Commit: https://github.com/vim/vim/commit/c150c09ec4f97636c6339f5687fdaa9f665095d2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 13 15:02:46 2021 +0100
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 https://github.com/vim/vim/issues/7827)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 13 Feb 2021 15:15:03 +0100 |
parents | a834f9c082e3 |
children | 949238ccbd50 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -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