diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-07-28 17:18:09 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-07-28 17:18:09 +0200 |
commit | d84b26a03b13cd816d80ff32b61e8de740d499ce (patch) | |
tree | 945aff2c7fdba4c7fe665044e53c0f8f6ce7d038 /src/if_ruby.c | |
parent | 2c8c681bfcd5138a0ec8ce018216dc2dc69a11a0 (diff) | |
download | vim-git-d84b26a03b13cd816d80ff32b61e8de740d499ce.tar.gz |
patch 8.1.0220: Ruby converts v:true and v:false to a numberv8.1.0220
Problem: Ruby converts v:true and v:false to a number.
Solution: Use Qtrue and Qfalse instead. (Masataka Pocke Kuwabara,
closes #3259)
Diffstat (limited to 'src/if_ruby.c')
-rw-r--r-- | src/if_ruby.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/if_ruby.c b/src/if_ruby.c index 4b9af318d..2e1f8d75a 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -1085,8 +1085,10 @@ static VALUE vim_to_ruby(typval_T *tv) } else if (tv->v_type == VAR_SPECIAL) { - if (tv->vval.v_number <= VVAL_TRUE) - result = INT2NUM(tv->vval.v_number); + if (tv->vval.v_number == VVAL_TRUE) + result = Qtrue; + else if (tv->vval.v_number == VVAL_FALSE) + result = Qfalse; } /* else return Qnil; */ return result; |