1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2023-04-17 19:23:45 +01:00
parent fc8a601c32
commit 42994bf678
3 changed files with 20 additions and 7 deletions

View File

@@ -656,6 +656,7 @@ func Test_defer_quitall()
vim9script
func DeferLevelTwo()
call writefile(['text'], 'XQuitallTwo', 'D')
call writefile(['quit'], 'XQuitallThree', 'a')
qa!
endfunc
@@ -671,6 +672,9 @@ func Test_defer_quitall()
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()