0
0
mirror of https://github.com/vim/vim.git synced 2025-10-06 05:44:14 -04:00

patch 8.2.3076: Vim9: using try in catch block causes a hang

Problem:    Vim9: using try in catch block causes a hang.
Solution:   Save and restore the ec_in_catch flag. (closes #8478)
This commit is contained in:
Bram Moolenaar
2021-06-30 12:02:24 +02:00
parent 80b2ba3e96
commit 3f987b5917
3 changed files with 32 additions and 1 deletions

View File

@@ -605,6 +605,32 @@ def Test_try_catch_throw()
unlet g:caught
enddef
def Test_try_in_catch()
var lines =<< trim END
vim9script
var seq = []
def DoIt()
try
seq->add('throw 1')
eval [][0]
seq->add('notreached')
catch
seq->add('catch')
try
seq->add('throw 2')
eval [][0]
seq->add('notreached')
catch /nothing/
seq->add('notreached')
endtry
seq->add('done')
endtry
enddef
DoIt()
assert_equal(['throw 1', 'catch', 'throw 2', 'done'], seq)
END
enddef
" :while at the very start of a function that :continue jumps to
def TryContinueFunc()
while g:Count < 2