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

patch 7.4.2119

Problem:    Closures are not supported.
Solution:   Capture variables in lambdas from the outer scope. (Yasuhiro
            Matsumoto, Ken Takata)
This commit is contained in:
Bram Moolenaar
2016-07-29 22:15:09 +02:00
parent 83a2a80d6f
commit 1e96d9bf98
9 changed files with 450 additions and 47 deletions

View File

@@ -1265,8 +1265,16 @@ set_ref_in_timer(int copyID)
for (timer = first_timer; timer != NULL; timer = timer->tr_next)
{
tv.v_type = VAR_PARTIAL;
tv.vval.v_partial = timer->tr_partial;
if (timer->tr_partial != NULL)
{
tv.v_type = VAR_PARTIAL;
tv.vval.v_partial = timer->tr_partial;
}
else
{
tv.v_type = VAR_FUNC;
tv.vval.v_string = timer->tr_callback;
}
abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL);
}
return abort;