Mercurial > vim
comparison src/vim9compile.c @ 23436:ab163feb30cb v8.2.2261
patch 8.2.2261: Vim9: boolean option gets string type
Commit: https://github.com/vim/vim/commit/d5ea8f08f78d20fde8773663894de5e8c023bd83
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jan 1 14:49:15 2021 +0100
patch 8.2.2261: Vim9: boolean option gets string type
Problem: Vim9: boolean option gets string type.
Solution: Check for VAR_BOOL. (closes https://github.com/vim/vim/issues/7588)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 01 Jan 2021 15:00:03 +0100 |
parents | 5807e3958e38 |
children | b0587f7ec422 |
comparison
equal
deleted
inserted
replaced
23435:d94ada879d70 | 23436:ab163feb30cb |
---|---|
3170 rettv.v_type = VAR_UNKNOWN; | 3170 rettv.v_type = VAR_UNKNOWN; |
3171 ret = eval_option(arg, &rettv, TRUE); | 3171 ret = eval_option(arg, &rettv, TRUE); |
3172 if (ret == OK) | 3172 if (ret == OK) |
3173 { | 3173 { |
3174 // include the '&' in the name, eval_option() expects it. | 3174 // include the '&' in the name, eval_option() expects it. |
3175 char_u *name = vim_strnsave(start, *arg - start); | 3175 char_u *name = vim_strnsave(start, *arg - start); |
3176 type_T *type = rettv.v_type == VAR_NUMBER ? &t_number : &t_string; | 3176 type_T *type = rettv.v_type == VAR_BOOL ? &t_bool |
3177 : rettv.v_type == VAR_NUMBER ? &t_number : &t_string; | |
3177 | 3178 |
3178 ret = generate_LOAD(cctx, ISN_LOADOPT, 0, name, type); | 3179 ret = generate_LOAD(cctx, ISN_LOADOPT, 0, name, type); |
3179 vim_free(name); | 3180 vim_free(name); |
3180 } | 3181 } |
3181 clear_tv(&rettv); | 3182 clear_tv(&rettv); |