patch 9.0.1462: recursively calling :defer function if it does :qa
Problem: Recursively calling :defer function if it does :qa.
Solution: Clear the defer entry before calling the function. (closes #12266)
diff --git a/src/testdir/test_user_func.vim b/src/testdir/test_user_func.vim
index ade259c..8715a0b 100644
--- a/src/testdir/test_user_func.vim
+++ b/src/testdir/test_user_func.vim
@@ -656,6 +656,7 @@
vim9script
func DeferLevelTwo()
call writefile(['text'], 'XQuitallTwo', 'D')
+ call writefile(['quit'], 'XQuitallThree', 'a')
qa!
endfunc
@@ -671,6 +672,9 @@
call assert_equal(0, v:shell_error)
call assert_false(filereadable('XQuitallOne'))
call assert_false(filereadable('XQuitallTwo'))
+ call assert_equal(['quit'], readfile('XQuitallThree'))
+
+ call delete('XQuitallThree')
endfunc
func Test_defer_quitall_in_expr_func()