summaryrefslogtreecommitdiff
path: root/src/vim9compile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-01-01 14:49:15 +0100
committerBram Moolenaar <Bram@vim.org>2021-01-01 14:49:15 +0100
commitd5ea8f08f78d20fde8773663894de5e8c023bd83 (patch)
treee7d521e8a0be248a4bd2c886bb649354c30492d9 /src/vim9compile.c
parent5efe0e5d16db070f0ab0b944686139e597afe166 (diff)
downloadvim-git-d5ea8f08f78d20fde8773663894de5e8c023bd83.tar.gz
patch 8.2.2261: Vim9: boolean option gets string typev8.2.2261
Problem: Vim9: boolean option gets string type. Solution: Check for VAR_BOOL. (closes #7588)
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index b483a6094..d44fe487c 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3172,8 +3172,9 @@ compile_get_option(char_u **arg, cctx_T *cctx)
if (ret == OK)
{
// include the '&' in the name, eval_option() expects it.
- char_u *name = vim_strnsave(start, *arg - start);
- type_T *type = rettv.v_type == VAR_NUMBER ? &t_number : &t_string;
+ char_u *name = vim_strnsave(start, *arg - start);
+ type_T *type = rettv.v_type == VAR_BOOL ? &t_bool
+ : rettv.v_type == VAR_NUMBER ? &t_number : &t_string;
ret = generate_LOAD(cctx, ISN_LOADOPT, 0, name, type);
vim_free(name);