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