diff src/typval.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 936f77929f16
children 0d2a709e2ff0
line wrap: on
line diff
--- a/src/typval.c
+++ b/src/typval.c
@@ -1639,10 +1639,10 @@ eval_option(
     int		c;
     int		working = (**arg == '+');    // has("+option")
     int		ret = OK;
-    int		opt_flags;
+    int		scope;
 
     // Isolate the option name and find its value.
-    option_end = find_option_end(arg, &opt_flags);
+    option_end = find_option_end(arg, &scope);
     if (option_end == NULL)
     {
 	if (rettv != NULL)
@@ -1659,7 +1659,7 @@ eval_option(
     c = *option_end;
     *option_end = NUL;
     opt_type = get_option_value(*arg, &numval,
-			       rettv == NULL ? NULL : &stringval, opt_flags);
+			       rettv == NULL ? NULL : &stringval, NULL, scope);
 
     if (opt_type == gov_unknown)
     {