0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.2284: Vim9: cannot set an option to a boolean value

Problem:    Vim9: cannot set an option to a boolean value.
Solution:   Check for VAR_BOOL. (closes #7603)
This commit is contained in:
Bram Moolenaar
2021-01-03 14:47:25 +01:00
parent e68b02a1c4
commit 31a201a04a
3 changed files with 13 additions and 1 deletions

View File

@@ -3508,7 +3508,9 @@ set_option_from_tv(char_u *varname, typval_T *varp)
char_u nbuf[NUMBUFLEN];
int error = FALSE;
if (!in_vim9script() || varp->v_type != VAR_STRING)
if (varp->v_type == VAR_BOOL)
numval = (long)varp->vval.v_number;
else if (!in_vim9script() || varp->v_type != VAR_STRING)
numval = (long)tv_get_number_chk(varp, &error);
strval = tv_get_string_buf_chk(varp, nbuf);
if (!error && strval != NULL)