Mercurial > vim
comparison src/structs.h @ 9626:172131507c85 v7.4.2090
commit https://github.com/vim/vim/commit/df48fb456fb6bf63d94cad9b302ff01d8ee8d311
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jul 22 21:50:18 2016 +0200
patch 7.4.2090
Problem: Using submatch() in a lambda passed to substitute() is verbose.
Solution: Use a static list and pass it as an optional argument to the
function. Fix memory leak.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 22 Jul 2016 22:00:07 +0200 |
parents | fa64afb99dda |
children | 80ac9cf77c9b |
comparison
equal
deleted
inserted
replaced
9625:4c2524dd2403 | 9626:172131507c85 |
---|---|
1241 list_T *lv_copylist; /* copied list used by deepcopy() */ | 1241 list_T *lv_copylist; /* copied list used by deepcopy() */ |
1242 char lv_lock; /* zero, VAR_LOCKED, VAR_FIXED */ | 1242 char lv_lock; /* zero, VAR_LOCKED, VAR_FIXED */ |
1243 list_T *lv_used_next; /* next list in used lists list */ | 1243 list_T *lv_used_next; /* next list in used lists list */ |
1244 list_T *lv_used_prev; /* previous list in used lists list */ | 1244 list_T *lv_used_prev; /* previous list in used lists list */ |
1245 }; | 1245 }; |
1246 | |
1247 /* | |
1248 * Static list with 10 items. Use init_static_list() to initialize. | |
1249 */ | |
1250 typedef struct { | |
1251 list_T sl_list; /* must be first */ | |
1252 listitem_T sl_items[10]; | |
1253 } staticList10_T; | |
1246 | 1254 |
1247 /* | 1255 /* |
1248 * Structure to hold an item of a Dictionary. | 1256 * Structure to hold an item of a Dictionary. |
1249 * Also used for a variable. | 1257 * Also used for a variable. |
1250 * The key is copied into "di_key" to avoid an extra alloc/free for it. | 1258 * The key is copied into "di_key" to avoid an extra alloc/free for it. |