0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -04:00

patch 9.0.0090: no error when assigning bool to a string option

Problem:    No error when assigning bool to a string option with setwinvar().
Solution:   Give an error (closes #10766)
This commit is contained in:
Bram Moolenaar
2022-07-27 12:30:13 +01:00
parent 7db3a8e329
commit 28f84e17b0
5 changed files with 23 additions and 0 deletions

View File

@@ -4223,6 +4223,11 @@ set_option_from_tv(char_u *varname, typval_T *varp)
if (varp->v_type == VAR_BOOL)
{
if (is_string_option(varname))
{
emsg(_(e_string_required));
return;
}
numval = (long)varp->vval.v_number;
strval = (char_u *)"0"; // avoid using "false"
}