0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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

@@ -865,13 +865,11 @@ ex_ruby(exarg_T *eap)
vim_str2rb_enc_str(const char *s)
{
#if RUBY_VERSION >= 19
int isnum;
long lval;
char_u *sval;
rb_encoding *enc;
isnum = get_option_value((char_u *)"enc", &lval, &sval, 0);
if (isnum == 0)
if (get_option_value((char_u *)"enc", &lval, &sval, 0) == gov_string)
{
enc = rb_enc_find((char *)sval);
vim_free(sval);
@@ -886,14 +884,12 @@ vim_str2rb_enc_str(const char *s)
eval_enc_string_protect(const char *str, int *state)
{
#if RUBY_VERSION >= 19
int isnum;
long lval;
char_u *sval;
rb_encoding *enc;
VALUE v;
isnum = get_option_value((char_u *)"enc", &lval, &sval, 0);
if (isnum == 0)
if (get_option_value((char_u *)"enc", &lval, &sval, 0) == gov_string)
{
enc = rb_enc_find((char *)sval);
vim_free(sval);