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

@@ -117,11 +117,11 @@ func Test_lua_eval()
" lua.eval with a bool
lua v = vim.eval('v:true')
call assert_equal('number', luaeval('vim.type(v)'))
call assert_equal(1, luaeval('v'))
call assert_equal('boolean', luaeval('vim.type(v)'))
call assert_equal(v:true, luaeval('v'))
lua v = vim.eval('v:false')
call assert_equal('number', luaeval('vim.type(v)'))
call assert_equal(0, luaeval('v'))
call assert_equal('boolean', luaeval('vim.type(v)'))
call assert_equal(v:false, luaeval('v'))
" lua.eval with a null
lua v = vim.eval('v:null')