0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.0399: using :defer in expression funcref not tested

Problem:    Using :defer in expression funcref not tested.
Solution:   Add a test.  Fix uncovered problems.
This commit is contained in:
Bram Moolenaar
2022-09-06 21:02:35 +01:00
parent ca16c60f33
commit 98aff658d5
5 changed files with 69 additions and 4 deletions

View File

@@ -859,6 +859,27 @@ in_def_function(void)
return current_ectx != NULL;
}
/*
* Clear "current_ectx" and return the previous value. To be used when calling
* a user function.
*/
ectx_T *
clear_currrent_ectx(void)
{
ectx_T *r = current_ectx;
current_ectx = NULL;
return r;
}
void
restore_current_ectx(ectx_T *ectx)
{
if (current_ectx != NULL)
iemsg("Restoring current_ectx while it is not NULL");
current_ectx = ectx;
}
/*
* Add an entry for a deferred function call to the currently executing
* function.
@@ -5335,7 +5356,7 @@ call_def_function(
if (idx < 0)
{
semsg(NGETTEXT(e_one_argument_too_few, e_nr_arguments_too_few,
-idx), -idx);
-idx), -idx);
goto failed_early;
}