diff src/if_lua.c @ 19102:ba9f50bfda83 v8.2.0111

patch 8.2.0111: VAR_SPECIAL is also used for booleans Commit: https://github.com/vim/vim/commit/9b4a15d5dba354d2e1e02871470bad103f34769a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 11 16:05:23 2020 +0100 patch 8.2.0111: VAR_SPECIAL is also used for booleans Problem: VAR_SPECIAL is also used for booleans. Solution: Add VAR_BOOL for better type checking.
author Bram Moolenaar <Bram@vim.org>
date Sat, 11 Jan 2020 16:15:04 +0100
parents f0f9692d4487
children 94eda51ba9ba
line wrap: on
line diff
--- a/src/if_lua.c
+++ b/src/if_lua.c
@@ -535,6 +535,7 @@ luaV_pushtypval(lua_State *L, typval_T *
 	case VAR_DICT:
 	    luaV_pushdict(L, tv->vval.v_dict);
 	    break;
+	case VAR_BOOL:
 	case VAR_SPECIAL:
 	    if (tv->vval.v_number <= VVAL_TRUE)
 		lua_pushinteger(L, (int) tv->vval.v_number);
@@ -564,7 +565,7 @@ luaV_totypval(lua_State *L, int pos, typ
     switch (lua_type(L, pos))
     {
 	case LUA_TBOOLEAN:
-	    tv->v_type = VAR_SPECIAL;
+	    tv->v_type = VAR_BOOL;
 	    tv->vval.v_number = (varnumber_T) lua_toboolean(L, pos);
 	    break;
 	case LUA_TNIL: