summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0672
blob: 0867f40bf1a55f92fec690f75c334c9b3b57d5d3 (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
78
79
80
81
82
83
84
85
86
87
88
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0672
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.0672
Problem:    The Lua interface doesn't know about v:null.
Solution:   Add Lua support for v:null. (Uji, closes #3744)
Files:	    src/if_lua.c, src/testdir/test_lua.vim


*** ../vim-8.1.0671/src/if_lua.c	2018-08-21 14:23:31.418606007 +0200
--- src/if_lua.c	2019-01-01 00:36:06.099146358 +0100
***************
*** 562,567 ****
--- 562,571 ----
  	    tv->v_type = VAR_SPECIAL;
  	    tv->vval.v_number = (varnumber_T) lua_toboolean(L, pos);
  	    break;
+ 	case LUA_TNIL:
+ 	    tv->v_type = VAR_SPECIAL;
+ 	    tv->vval.v_number = VVAL_NULL;
+ 	    break;
  	case LUA_TSTRING:
  	    tv->v_type = VAR_STRING;
  	    tv->vval.v_string = vim_strsave((char_u *) lua_tostring(L, pos));
*** ../vim-8.1.0671/src/testdir/test_lua.vim	2018-07-25 22:02:32.235966277 +0200
--- src/testdir/test_lua.vim	2019-01-01 00:36:06.099146358 +0100
***************
*** 298,314 ****
    lua l:add('abc')
    lua l:add(true)
    lua l:add(false)
    lua l:add(vim.eval("[1, 2, 3]"))
    lua l:add(vim.eval("{'a':1, 'b':2, 'c':3}"))
!   call assert_equal([123.0, 'abc', v:true, v:false, [1, 2, 3], {'a': 1, 'b': 2, 'c': 3}], l)
!   call assert_equal(6.0, luaeval('#l'))
    call assert_match('^list: \%(0x\)\?\x\+$', luaeval('tostring(l)'))
  
    lua l[0] = 124
!   lua l[4] = nil
    lua l:insert('first')
    lua l:insert('xx', 3)
!   call assert_equal(['first', 124.0, 'abc', 'xx', v:true, v:false, {'a': 1, 'b': 2, 'c': 3}], l)
  
    lockvar 1 l
    call assert_fails('lua l:add("x")', '[string "vim chunk"]:1: list is locked')
--- 298,315 ----
    lua l:add('abc')
    lua l:add(true)
    lua l:add(false)
+   lua l:add(nil)
    lua l:add(vim.eval("[1, 2, 3]"))
    lua l:add(vim.eval("{'a':1, 'b':2, 'c':3}"))
!   call assert_equal([123.0, 'abc', v:true, v:false, v:null, [1, 2, 3], {'a': 1, 'b': 2, 'c': 3}], l)
!   call assert_equal(7.0, luaeval('#l'))
    call assert_match('^list: \%(0x\)\?\x\+$', luaeval('tostring(l)'))
  
    lua l[0] = 124
!   lua l[5] = nil
    lua l:insert('first')
    lua l:insert('xx', 3)
!   call assert_equal(['first', 124.0, 'abc', 'xx', v:true, v:false, v:null, {'a': 1, 'b': 2, 'c': 3}], l)
  
    lockvar 1 l
    call assert_fails('lua l:add("x")', '[string "vim chunk"]:1: list is locked')
*** ../vim-8.1.0671/src/version.c	2018-12-31 23:58:20.250887178 +0100
--- src/version.c	2019-01-01 00:41:29.936347640 +0100
***************
*** 801,802 ****
--- 801,804 ----
  {   /* Add new patch number below this line */
+ /**/
+     672,
  /**/

-- 
From "know your smileys":
 <<<:-{    Worf (Never smiles anyways, so he's a bad smiley)

 /// 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    ///