Mercurial > vim
comparison src/ex_cmds2.c @ 9686:8c2553beff0f v7.4.2119
commit https://github.com/vim/vim/commit/1e96d9bf98f9ab84d5af7f98d6a961d91b17364f
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jul 29 22:15:09 2016 +0200
patch 7.4.2119
Problem: Closures are not supported.
Solution: Capture variables in lambdas from the outer scope. (Yasuhiro
Matsumoto, Ken Takata)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 29 Jul 2016 22:30:08 +0200 |
parents | fd9727ae3c49 |
children | cce76af1cc6a |
comparison
equal
deleted
inserted
replaced
9685:fee40b9f4989 | 9686:8c2553beff0f |
---|---|
1263 timer_T *timer; | 1263 timer_T *timer; |
1264 typval_T tv; | 1264 typval_T tv; |
1265 | 1265 |
1266 for (timer = first_timer; timer != NULL; timer = timer->tr_next) | 1266 for (timer = first_timer; timer != NULL; timer = timer->tr_next) |
1267 { | 1267 { |
1268 tv.v_type = VAR_PARTIAL; | 1268 if (timer->tr_partial != NULL) |
1269 tv.vval.v_partial = timer->tr_partial; | 1269 { |
1270 tv.v_type = VAR_PARTIAL; | |
1271 tv.vval.v_partial = timer->tr_partial; | |
1272 } | |
1273 else | |
1274 { | |
1275 tv.v_type = VAR_FUNC; | |
1276 tv.vval.v_string = timer->tr_callback; | |
1277 } | |
1270 abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL); | 1278 abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL); |
1271 } | 1279 } |
1272 return abort; | 1280 return abort; |
1273 } | 1281 } |
1274 # endif | 1282 # endif |