patch 8.2.2650: Vim9: command modifiers not handled in nested function
Problem: Vim9: command modifiers not handled in nested function.
Solution: Keep function-local info in a structure and save it on the stack.
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim
index 2755412..5faae82 100644
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -2363,6 +2363,29 @@
delete(fname)
enddef
+def Test_cmdmod_silent_nested()
+ var lines =<< trim END
+ vim9script
+ var result = ''
+
+ def Error()
+ result ..= 'Eb'
+ eval [][0]
+ result ..= 'Ea'
+ enddef
+
+ def Crash()
+ result ..= 'Cb'
+ sil! Error()
+ result ..= 'Ca'
+ enddef
+
+ Crash()
+ assert_equal('CbEbEaCa', result)
+ END
+ CheckScriptSuccess(lines)
+enddef
+
def Test_dict_member_with_silent()
var lines =<< trim END
vim9script