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 -- [email protected] -- 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 ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.