Mercurial > vim
diff src/if_ruby.c @ 23422:bb0c53f4ef8b v8.2.2254
patch 8.2.2254: Vim9: bool option type is number
Commit: https://github.com/vim/vim/commit/dd1f426bd617ac6a775f2e7795ff0b159e3fa315
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Dec 31 17:41:01 2020 +0100
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 31 Dec 2020 17:45:04 +0100 |
parents | f719577ddae6 |
children | 19d54961af72 |
line wrap: on
line diff
--- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -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);