diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-07-20 21:31:32 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-07-20 21:31:32 +0200 |
commit | d43906d2e5969288f239df851f5ad7b1dc2c7251 (patch) | |
tree | a3d3f8f6cefa3f05e63aa15445e3cb1bab03d3fb /src/evalvars.c | |
parent | 470adb827f3d9e6cf62f685738d2db216daf3738 (diff) | |
download | vim-git-d43906d2e5969288f239df851f5ad7b1dc2c7251.tar.gz |
patch 8.2.1255: cannot use a lambda with quickfix functionsv8.2.1255
Problem: Cannot use a lambda with quickfix functions.
Solution: Add support for lambda. (Yegappan Lakshmanan, closes #6499)
Diffstat (limited to 'src/evalvars.c')
-rw-r--r-- | src/evalvars.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/evalvars.c b/src/evalvars.c index 197a19dd1..e2469b0e8 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -3849,6 +3849,27 @@ set_callback(callback_T *dest, callback_T *src) } /* + * Copy callback from "src" to "dest", incrementing the refcounts. + */ + void +copy_callback(callback_T *dest, callback_T *src) +{ + dest->cb_partial = src->cb_partial; + if (dest->cb_partial != NULL) + { + dest->cb_name = src->cb_name; + dest->cb_free_name = FALSE; + ++dest->cb_partial->pt_refcount; + } + else + { + dest->cb_name = vim_strsave(src->cb_name); + dest->cb_free_name = TRUE; + func_ref(src->cb_name); + } +} + +/* * Unref/free "callback" returned by get_callback() or set_callback(). */ void |