summaryrefslogtreecommitdiffstats
path: root/src/if_lua.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-23 19:46:28 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-23 19:46:28 +0100
commit520e1e41f35b063ede63b41738c82d6636e78c34 (patch)
tree4c6a94e4e8f3f2047b91886077d4ecb916b30401 /src/if_lua.c
parent6920c72d4d62c8dc5596e9f392e38204f561d7af (diff)
patch 7.4.1154v7.4.1154
Problem: No support for JSON. Solution: Add jsonencode() and jsondecode(). Also add v:false, v:true, v:null and v:none.
Diffstat (limited to 'src/if_lua.c')
-rw-r--r--src/if_lua.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/if_lua.c b/src/if_lua.c
index 46f881a9bd..1c8512fec5 100644
--- a/src/if_lua.c
+++ b/src/if_lua.c
@@ -499,6 +499,12 @@ luaV_pushtypval(lua_State *L, typval_T *tv)
case VAR_DICT:
luaV_pushdict(L, tv->vval.v_dict);
break;
+ case VAR_SPECIAL:
+ if (tv->vval.v_number <= VVAL_TRUE)
+ lua_pushinteger(L, (int) tv->vval.v_number);
+ else
+ lua_pushnil(L);
+ break;
default:
lua_pushnil(L);
}
@@ -510,7 +516,7 @@ luaV_totypval (lua_State *L, int pos, typval_T *tv)
{
switch(lua_type(L, pos)) {
case LUA_TBOOLEAN:
- tv->v_type = VAR_NUMBER;
+ tv->v_type = VAR_SPECIAL;
tv->vval.v_number = (varnumber_T) lua_toboolean(L, pos);
break;
case LUA_TSTRING: