Mercurial > vim
diff src/if_lua.c @ 7712:bce3b5ddb393 v7.4.1154
commit https://github.com/vim/vim/commit/520e1e41f35b063ede63b41738c82d6636e78c34
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 23 19:46:28 2016 +0100
patch 7.4.1154
Problem: No support for JSON.
Solution: Add jsonencode() and jsondecode(). Also add v:false, v:true,
v:null and v:none.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 23 Jan 2016 20:00:04 +0100 |
parents | 53163e4d9e4f |
children | 24b43dd167eb |
line wrap: on
line diff
--- a/src/if_lua.c +++ b/src/if_lua.c @@ -499,6 +499,12 @@ luaV_pushtypval(lua_State *L, typval_T * 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, ty { 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: