fix(vim.json): properly treat luanil options as booleans (#28622)

Note: Upstream doesn't have this. It's an Nvim addition.
This commit is contained in:
zeertzjq
2024-05-03 19:26:56 +08:00
committed by GitHub
parent 40ce857797
commit e15991c811
2 changed files with 16 additions and 8 deletions

View File

@@ -32,6 +32,18 @@ describe('vim.json.decode()', function()
baz = vim.NIL,
foo = { a = 'b' },
}, exec_lua([[return vim.json.decode(..., {})]], jsonstr))
eq(
{
arr = { 1, 2, vim.NIL },
bar = { 3, 7 },
baz = vim.NIL,
foo = { a = 'b' },
},
exec_lua(
[[return vim.json.decode(..., { luanil = { array = false, object = false } })]],
jsonstr
)
)
eq({
arr = { 1, 2, vim.NIL },
bar = { 3, 7 },