diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-07-29 22:15:09 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-07-29 22:15:09 +0200 |
commit | 1e96d9bf98f9ab84d5af7f98d6a961d91b17364f (patch) | |
tree | dd81c13eb8896eb9b5c3a5f311eefdd39829c907 /src/ex_cmds2.c | |
parent | 83a2a80d6f699ad9a236431170038698e355c025 (diff) | |
download | vim-git-1e96d9bf98f9ab84d5af7f98d6a961d91b17364f.tar.gz |
patch 7.4.2119v7.4.2119
Problem: Closures are not supported.
Solution: Capture variables in lambdas from the outer scope. (Yasuhiro
Matsumoto, Ken Takata)
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r-- | src/ex_cmds2.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 83305b240..ec9f50a52 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -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; |