diff options
-rw-r--r-- | src/evalvars.c | 12 | ||||
-rw-r--r-- | src/testdir/test_vim9_builtin.vim | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/evalvars.c b/src/evalvars.c index 42b7ef58d7..c6b03e9938 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -3509,10 +3509,16 @@ set_option_from_tv(char_u *varname, typval_T *varp) int error = FALSE; 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); + strval = (char_u *)"0"; // avoid using "false" + } + 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) set_option_value(varname, numval, strval, OPT_LOCAL); } diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim index 74031d4d09..4eb2d76dfd 100644 --- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -662,6 +662,8 @@ def Test_setbufvar() settabwinvar(1, 1, '&ts', 15) &ts->assert_equal(15) setlocal ts=8 + settabwinvar(1, 1, '&list', false) + &list->assert_equal(false) settabwinvar(1, 1, '&list', true) &list->assert_equal(true) setlocal list& diff --git a/src/version.c b/src/version.c index cf7964ccbc..ea53d3a72a 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2285, +/**/ 2284, /**/ 2283, |