fix(version): fix vim.version().prerelease

fixes #28782 (when backported)
This commit is contained in:
bfredl
2024-05-16 20:07:45 +02:00
committed by Björn Linse
parent a664246171
commit d049752e45
2 changed files with 6 additions and 2 deletions

View File

@ -260,7 +260,11 @@ fixdict(1 + #version)
for _, item in ipairs(version) do
-- NB: all items are mandatory. But any error will be less confusing
-- with placeholder vim.NIL (than invalid mpack data)
put(item[1], item[2] or vim.NIL)
local val = item[2]
if val == nil then
val = vim.NIL
end
put(item[1], val)
end
put('build', version_build)

View File

@ -2,7 +2,7 @@ return {
{"major", ${NVIM_VERSION_MAJOR}},
{"minor", ${NVIM_VERSION_MINOR}},
{"patch", ${NVIM_VERSION_PATCH}},
{"prerelease", "$NVIM_VERSION_PRERELEASE" ~= ""},
{"prerelease", "${NVIM_VERSION_PRERELEASE}" ~= ""},
{"api_level", ${NVIM_API_LEVEL}},
{"api_compatible", ${NVIM_API_LEVEL_COMPAT}},
{"api_prerelease", ${NVIM_API_PRERELEASE}},