0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.0672: the Lua interface doesn't know about v:null

Problem:    The Lua interface doesn't know about v:null.
Solution:   Add Lua support for v:null. (Uji, closes #3744)
This commit is contained in:
Bram Moolenaar
2019-01-01 00:41:54 +01:00
parent e1e714ef0d
commit 9067cd6cdf
3 changed files with 11 additions and 4 deletions

View File

@@ -562,6 +562,10 @@ luaV_totypval(lua_State *L, int pos, typval_T *tv)
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));