1
0
forked from aniani/vim

patch 8.2.2254: Vim9: bool option type is number

Problem:    Vim9: bool option type is number.
Solution:   Have get_option_value() return a different value for bool and
            number options. (closes #7583)
This commit is contained in:
Bram Moolenaar
2020-12-31 17:41:01 +01:00
parent ca2f7e7af3
commit dd1f426bd6
12 changed files with 104 additions and 56 deletions

View File

@@ -5191,9 +5191,9 @@ get_var_dest(
if (*name == '&')
{
int cc;
long numval;
int opt_type;
int cc;
long numval;
getoption_T opt_type;
*dest = dest_option;
if (cmdidx == CMD_final || cmdidx == CMD_const)
@@ -5214,15 +5214,24 @@ get_var_dest(
opt_type = get_option_value(skip_option_env_lead(name),
&numval, NULL, *opt_flags);
*p = cc;
if (opt_type == -3)
switch (opt_type)
{
semsg(_(e_unknown_option), name);
return FAIL;
case gov_unknown:
semsg(_(e_unknown_option), name);
return FAIL;
case gov_string:
case gov_hidden_string:
*type = &t_string;
break;
case gov_bool:
case gov_hidden_bool:
*type = &t_bool;
break;
case gov_number:
case gov_hidden_number:
*type = &t_number;
break;
}
if (opt_type == -2 || opt_type == 0)
*type = &t_string;
else
*type = &t_number; // both number and boolean option
}
else if (*name == '$')
{