comparison src/eval.c @ 26441:65ab0b035dd8 v8.2.3751

patch 8.2.3751: cannot assign a lambda to an option that takes a function Commit: https://github.com/vim/vim/commit/6409553b6e3b4de4e1d72b8ee5445595214581ff Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Mon Dec 6 11:03:55 2021 +0000 patch 8.2.3751: cannot assign a lambda to an option that takes a function Problem: Cannot assign a lambda to an option that takes a function. Solution: Automatically convert the lambda to a string. (Yegappan Lakshmanan, closes #9286)
author Bram Moolenaar <Bram@vim.org>
date Mon, 06 Dec 2021 12:15:04 +0100
parents 8afd7aa25ab6
children cc95e10e1cf2
comparison
equal deleted inserted replaced
26440:f6f5f604c17c 26441:65ab0b035dd8
6279 * "arg" points to the "&" or '+' when called, to "option" when returning. 6279 * "arg" points to the "&" or '+' when called, to "option" when returning.
6280 * Returns NULL when no option name found. Otherwise pointer to the char 6280 * Returns NULL when no option name found. Otherwise pointer to the char
6281 * after the option name. 6281 * after the option name.
6282 */ 6282 */
6283 char_u * 6283 char_u *
6284 find_option_end(char_u **arg, int *opt_flags) 6284 find_option_end(char_u **arg, int *scope)
6285 { 6285 {
6286 char_u *p = *arg; 6286 char_u *p = *arg;
6287 6287
6288 ++p; 6288 ++p;
6289 if (*p == 'g' && p[1] == ':') 6289 if (*p == 'g' && p[1] == ':')
6290 { 6290 {
6291 *opt_flags = OPT_GLOBAL; 6291 *scope = OPT_GLOBAL;
6292 p += 2; 6292 p += 2;
6293 } 6293 }
6294 else if (*p == 'l' && p[1] == ':') 6294 else if (*p == 'l' && p[1] == ':')
6295 { 6295 {
6296 *opt_flags = OPT_LOCAL; 6296 *scope = OPT_LOCAL;
6297 p += 2; 6297 p += 2;
6298 } 6298 }
6299 else 6299 else
6300 *opt_flags = 0; 6300 *scope = 0;
6301 6301
6302 if (!ASCII_ISALPHA(*p)) 6302 if (!ASCII_ISALPHA(*p))
6303 return NULL; 6303 return NULL;
6304 *arg = p; 6304 *arg = p;
6305 6305