summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0220
blob: 523cbc2776bba22e94f8b250e35727649f779050 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0220
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0220
Problem:    Ruby converts v:true and v:false to a number.
Solution:   Use Qtrue and Qfalse instead. (Masataka Pocke Kuwabara,
            closes #3259)
Files:	    src/if_ruby.c, src/testdir/test_ruby.vim


*** ../vim-8.1.0219/src/if_ruby.c	2018-07-25 22:02:32.231966301 +0200
--- src/if_ruby.c	2018-07-28 17:12:56.698546960 +0200
***************
*** 1085,1092 ****
      }
      else if (tv->v_type == VAR_SPECIAL)
      {
! 	if (tv->vval.v_number <= VVAL_TRUE)
! 	    result = INT2NUM(tv->vval.v_number);
      } /* else return Qnil; */
  
      return result;
--- 1085,1094 ----
      }
      else if (tv->v_type == VAR_SPECIAL)
      {
! 	if (tv->vval.v_number == VVAL_TRUE)
! 	    result = Qtrue;
! 	else if (tv->vval.v_number == VVAL_FALSE)
! 	    result = Qfalse;
      } /* else return Qnil; */
  
      return result;
*** ../vim-8.1.0219/src/testdir/test_ruby.vim	2018-07-25 22:02:32.235966277 +0200
--- src/testdir/test_ruby.vim	2018-07-28 17:12:56.698546960 +0200
***************
*** 33,38 ****
--- 33,46 ----
    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
*** ../vim-8.1.0219/src/version.c	2018-07-28 17:07:48.608154066 +0200
--- src/version.c	2018-07-28 17:14:20.930093228 +0200
***************
*** 800,801 ****
--- 800,803 ----
  {   /* Add new patch number below this line */
+ /**/
+     220,
  /**/

-- 
A real patriot is the fellow who gets a parking ticket and rejoices
that the system works.


 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///