neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 43e76cc3462bc5bcf2b6ade8af1c36e21d3da3c9
parent 08db61b19b8fa07131fdcbea306893539963d4cb
Author: Julian Grinblat <julian@dotcore.co.il>
Date:   Thu, 22 Jun 2023 16:36:38 +0900

fix: tostring(vim.version()) fails if build is NIL #24097

Problem:
Since #23925, Version.build may be vim.NIL, which causes tostring() to fail:
    E5108: Error executing lua E5114: Error while converting print argument #1: …/version.lua:129:
    attempt to concatenate field 'build' (a userdata value)
    stack traceback:
            [C]: in function 'print'
            [string ":lua"]:1: in main chunk

Solution:
Handle vim.NIL in Version:__tostring().
Diffstat:
Mruntime/lua/vim/version.lua | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/lua/vim/version.lua b/runtime/lua/vim/version.lua @@ -125,7 +125,7 @@ function Version:__tostring() if self.prerelease then ret = ret .. '-' .. self.prerelease end - if self.build then + if self.build and self.build ~= vim.NIL then ret = ret .. '+' .. self.build end return ret