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

patch 8.2.0111: VAR_SPECIAL is also used for booleans

Problem:    VAR_SPECIAL is also used for booleans.
Solution:   Add VAR_BOOL for better type checking.
This commit is contained in:
Bram Moolenaar
2020-01-11 16:05:23 +01:00
parent e05a89ac63
commit 9b4a15d5db
16 changed files with 87 additions and 54 deletions

View File

@@ -1183,7 +1183,7 @@ vim_to_ruby(typval_T *tv)
}
}
}
else if (tv->v_type == VAR_SPECIAL)
else if (tv->v_type == VAR_BOOL || tv->v_type == VAR_SPECIAL)
{
if (tv->vval.v_number == VVAL_TRUE)
result = Qtrue;
@@ -1827,11 +1827,11 @@ ruby_convert_to_vim_value(VALUE val, typval_T *rettv)
rettv->vval.v_number = VVAL_NULL;
break;
case T_TRUE:
rettv->v_type = VAR_SPECIAL;
rettv->v_type = VAR_BOOL;
rettv->vval.v_number = VVAL_TRUE;
break;
case T_FALSE:
rettv->v_type = VAR_SPECIAL;
rettv->v_type = VAR_BOOL;
rettv->vval.v_number = VVAL_FALSE;
break;
case T_BIGNUM: