diff options
-rw-r--r-- | src/if_ruby.c | 6 | ||||
-rw-r--r-- | src/testdir/test_ruby.vim | 8 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/if_ruby.c b/src/if_ruby.c index 4b9af318d2..2e1f8d75ae 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; diff --git a/src/testdir/test_ruby.vim b/src/testdir/test_ruby.vim index ae27b39cd3..36442fcbca 100644 --- a/src/testdir/test_ruby.vim +++ b/src/testdir/test_ruby.vim @@ -33,6 +33,14 @@ func Test_ruby_evaluate_dict() call assert_equal(['{"a"=>"foo", "b"=>123}'], split(l:out, "\n")) endfunc +func Test_ruby_evaluate_special_var() + let l = [v:true, v:false, v:null, v:none] + redir => l:out + ruby d = Vim.evaluate("l"); print d + redir END + call assert_equal(['[true, false, nil, nil]'], split(l:out, "\n")) +endfunc + func Test_rubydo() " Check deleting lines does not trigger ml_get error. new diff --git a/src/version.c b/src/version.c index 4ea5c75bf9..d69a8c73d6 100644 --- a/src/version.c +++ b/src/version.c @@ -799,6 +799,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 220, +/**/ 219, /**/ 218, |