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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user