diff src/evalvars.c @ 23483:ce7d6b461660 v8.2.2284

patch 8.2.2284: Vim9: cannot set an option to a boolean value Commit: https://github.com/vim/vim/commit/31a201a04aa95708af5d62070d2d397a201cc1a5 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 3 14:47:25 2021 +0100 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 https://github.com/vim/vim/issues/7603)
author Bram Moolenaar <Bram@vim.org>
date Sun, 03 Jan 2021 15:00:04 +0100
parents d2b1269c2c68
children 198ad7ef2420
line wrap: on
line diff
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -3508,7 +3508,9 @@ set_option_from_tv(char_u *varname, typv
     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)