Mercurial > vim
comparison src/tag.c @ 26388:8aba638e91eb v8.2.3725
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Commit: https://github.com/vim/vim/commit/8658c759f05b317707d56e3b65a5ef63930c7498
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Fri Dec 3 11:09:29 2021 +0000
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Problem: Cannot use a lambda for 'completefunc' and 'omnifunc'.
Solution: Implement lambda support. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/9257)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 03 Dec 2021 12:15:04 +0100 |
parents | 3aa48d4e3dc8 |
children | ef0c07cbf53f |
comparison
equal
deleted
inserted
replaced
26387:b6eb7e295973 | 26388:8aba638e91eb |
---|---|
113 * Reads the 'tagfunc' option value and convert that to a callback value. | 113 * Reads the 'tagfunc' option value and convert that to a callback value. |
114 * Invoked when the 'tagfunc' option is set. The option value can be a name of | 114 * Invoked when the 'tagfunc' option is set. The option value can be a name of |
115 * a function (string), or function(<name>) or funcref(<name>) or a lambda. | 115 * a function (string), or function(<name>) or funcref(<name>) or a lambda. |
116 */ | 116 */ |
117 int | 117 int |
118 set_tagfunc_option() | 118 set_tagfunc_option(void) |
119 { | 119 { |
120 #ifdef FEAT_EVAL | 120 #ifdef FEAT_EVAL |
121 free_callback(&tfu_cb); | 121 free_callback(&tfu_cb); |
122 free_callback(&curbuf->b_tfu_cb); | 122 free_callback(&curbuf->b_tfu_cb); |
123 | 123 |
146 /* | 146 /* |
147 * Copy the global 'tagfunc' callback function to the buffer-local 'tagfunc' | 147 * Copy the global 'tagfunc' callback function to the buffer-local 'tagfunc' |
148 * callback for 'buf'. | 148 * callback for 'buf'. |
149 */ | 149 */ |
150 void | 150 void |
151 buf_set_tfu_callback(buf_T *buf UNUSED) | 151 set_buflocal_tfu_callback(buf_T *buf UNUSED) |
152 { | 152 { |
153 #ifdef FEAT_EVAL | 153 #ifdef FEAT_EVAL |
154 free_callback(&buf->b_tfu_cb); | 154 free_callback(&buf->b_tfu_cb); |
155 if (tfu_cb.cb_name != NULL && *tfu_cb.cb_name != NUL) | 155 if (tfu_cb.cb_name != NULL && *tfu_cb.cb_name != NUL) |
156 copy_callback(&buf->b_tfu_cb, &tfu_cb); | 156 copy_callback(&buf->b_tfu_cb, &tfu_cb); |