1
0
forked from aniani/vim

patch 9.1.0848: if_lua: v:false/v:true are not evaluated to boolean

Problem:  if_lua: v:false/v:true are not evaluated to boolean
Solution: Use lua_pushboolean() instead of lua_pushinteger().
          (zeertzjq)

fixes: #15994
closes: #11419

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2024-11-09 18:30:10 +01:00
committed by Christian Brabandt
parent a14c457cad
commit 50732c7ba6
4 changed files with 8 additions and 6 deletions

View File

@@ -595,7 +595,7 @@ luaV_pushtypval(lua_State *L, typval_T *tv)
case VAR_BOOL:
case VAR_SPECIAL:
if (tv->vval.v_number <= VVAL_TRUE)
lua_pushinteger(L, (int) tv->vval.v_number);
lua_pushboolean(L, (int) tv->vval.v_number);
else
lua_pushnil(L);
break;