Mercurial > vim
diff src/if_ruby.c @ 19102:ba9f50bfda83 v8.2.0111
patch 8.2.0111: VAR_SPECIAL is also used for booleans
Commit: https://github.com/vim/vim/commit/9b4a15d5dba354d2e1e02871470bad103f34769a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 11 16:05:23 2020 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 11 Jan 2020 16:15:04 +0100 |
parents | 23df4b83fd31 |
children | 1cae476a7c82 |
line wrap: on
line diff
--- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -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, typ 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: