Commit Graph

11 Commits

Author SHA1 Message Date
zeertzjq
0d7bed34a2
vim-patch:9.0.1470: deferred functions invoked in unexpected order (#23199)
Problem:    Deferred functions invoked in unexpected order when using :qa and
            autocommands.
Solution:   Call deferred functions for the current funccal before using the
            stack. (closes vim/vim#12278)

1be4b81bfb
2023-04-19 22:09:48 +08:00
zeertzjq
a0c982671e vim-patch:9.0.1469: deferred functions not called from autocommands
Problem:    Deferred functions not called from autocommands.
Solution:   Also go through the funccal_stack. (closes vim/vim#12267)

960cf9119e
2023-04-19 08:09:46 +08:00
zeertzjq
a11849abdf vim-patch:9.0.1468: recursively calling :defer function if it does :qa
Problem:    Recursively calling :defer function if it does :qa in a compiled
            function.
Solution:   Clear the defer entry before calling the function. (closes vim/vim#12271)

a1f2b5ddc6
2023-04-19 08:09:46 +08:00
zeertzjq
8e0ad6e261 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 vim/vim#12266)

42994bf678

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 08:09:46 +08:00
zeertzjq
7a3f86481e vim-patch:9.0.0419: the :defer command does not check the function arguments
Problem:    The :defer command does not check the function argument count and
            types.
Solution:   Check the function arguments when adding a deferred function.

169003289f

Cherry-pick check_internal_func() from Vim, but use EvalFuncDef pointer
as first argument.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 09:38:09 +08:00
zeertzjq
6bfba3660c vim-patch:9.0.0406: deferred functions not invoked when partial func exits
Problem:    Deferred functions not invoked when partial func exits.
Solution:   Create a funccall_T when calling a :def function.

9667b2c888

The remove_funccal() function is currently unused, but it will be used
in patch 9.0.0618.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 09:08:08 +08:00
zeertzjq
7b05ddbb72 vim-patch:9.0.0397: :defer not tested with exceptions and ":qa!"
Problem:    :defer not tested with exceptions and ":qa!".
Solution:   Test :defer works when exceptions are thrown and when ":qa!" is
            used.  Invoke the deferred calls on exit.

58779858fb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 15:04:41 +08:00
zeertzjq
335bef0c21 vim-patch:9.0.0390: cannot use a partial with :defer
Problem:    Cannot use a partial with :defer.
Solution:   Add the partial arguments before the other arguments.  Disallow
            using a dictionary.

86d87256c4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 15:04:41 +08:00
zeertzjq
b75634e55e vim-patch:9.0.0370: cleaning up afterwards can make a function messy
Problem:    Cleaning up afterwards can make a function messy.
Solution:   Add the :defer command.

1d84f7608f

Omit EX_EXPR_ARG: Vim9 script only.
Make :def throw E319 to avoid confusing behavior.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 15:04:40 +08:00
zeertzjq
6adfd24a06
vim-patch:8.2.4716: memory allocation failure not tested when defining a function (#23117)
Problem:    Memory allocation failure not tested when defining a function.
Solution:   Add a test. (Yegappan Lakshmanan, closes vim/vim#10127)

7c7e19cf50

test_alloc_fail() is N/A.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-16 08:26:42 +08:00
dundargoc
af23d17388
test: move oldtests to test directory (#22536)
The new oldtest directory is in test/old/testdir. The reason for this is
that many tests have hardcoded the parent directory name to be
'testdir'.
2023-03-07 11:13:04 +08:00