summaryrefslogtreecommitdiff
path: root/src/if_mzsch.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2021-12-06 11:03:55 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-06 11:03:55 +0000
commit6409553b6e3b4de4e1d72b8ee5445595214581ff (patch)
tree1b24d5f956763a1bc7a5b47fc9875598d0d438d6 /src/if_mzsch.c
parent40bcec1bac34d34a3d4d7c5f6b2cc1f163acbd00 (diff)
downloadvim-git-6409553b6e3b4de4e1d72b8ee5445595214581ff.tar.gz
patch 8.2.3751: cannot assign a lambda to an option that takes a functionv8.2.3751
Problem: Cannot assign a lambda to an option that takes a function. Solution: Automatically convert the lambda to a string. (Yegappan Lakshmanan, closes #9286)
Diffstat (limited to 'src/if_mzsch.c')
-rw-r--r--src/if_mzsch.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/if_mzsch.c b/src/if_mzsch.c
index 57b593a19..41b6d0006 100644
--- a/src/if_mzsch.c
+++ b/src/if_mzsch.c
@@ -1715,7 +1715,7 @@ get_option(void *data, int argc, Scheme_Object **argv)
getoption_T rc;
Scheme_Object *rval = NULL;
Scheme_Object *name = NULL;
- int opt_flags = 0;
+ int scope = 0;
buf_T *save_curb = curbuf;
win_T *save_curw = curwin;
@@ -1736,11 +1736,11 @@ get_option(void *data, int argc, Scheme_Object **argv)
}
if (argv[1] == M_global)
- opt_flags = OPT_GLOBAL;
+ scope = OPT_GLOBAL;
else if (SCHEME_VIMBUFFERP(argv[1]))
{
curbuf = get_valid_buffer(argv[1]);
- opt_flags = OPT_LOCAL;
+ scope = OPT_LOCAL;
}
else if (SCHEME_VIMWINDOWP(argv[1]))
{
@@ -1748,14 +1748,14 @@ get_option(void *data, int argc, Scheme_Object **argv)
curwin = win;
curbuf = win->w_buffer;
- opt_flags = OPT_LOCAL;
+ scope = OPT_LOCAL;
}
else
scheme_wrong_type(prim->name, "vim-buffer/window", 1, argc, argv);
}
rc = get_option_value(BYTE_STRING_VALUE(name), &value, (char_u **)&strval,
- opt_flags);
+ NULL, scope);
curbuf = save_curb;
curwin = save_curw;
@@ -1793,7 +1793,7 @@ get_option(void *data, int argc, Scheme_Object **argv)
set_option(void *data, int argc, Scheme_Object **argv)
{
char_u *command = NULL;
- int opt_flags = 0;
+ int scope = 0;
buf_T *save_curb = curbuf;
win_T *save_curw = curwin;
Vim_Prim *prim = (Vim_Prim *)data;
@@ -1814,18 +1814,18 @@ set_option(void *data, int argc, Scheme_Object **argv)
}
if (argv[1] == M_global)
- opt_flags = OPT_GLOBAL;
+ scope = OPT_GLOBAL;
else if (SCHEME_VIMBUFFERP(argv[1]))
{
curbuf = get_valid_buffer(argv[1]);
- opt_flags = OPT_LOCAL;
+ scope = OPT_LOCAL;
}
else if (SCHEME_VIMWINDOWP(argv[1]))
{
win_T *win = get_valid_window(argv[1]);
curwin = win;
curbuf = win->w_buffer;
- opt_flags = OPT_LOCAL;
+ scope = OPT_LOCAL;
}
else
scheme_wrong_type(prim->name, "vim-buffer/window", 1, argc, argv);
@@ -1834,7 +1834,7 @@ set_option(void *data, int argc, Scheme_Object **argv)
// do_set can modify cmd, make copy
command = vim_strsave(BYTE_STRING_VALUE(cmd));
MZ_GC_UNREG();
- do_set(command, opt_flags);
+ do_set(command, scope);
vim_free(command);
update_screen(NOT_VALID);
curbuf = save_curb;