aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/version.lua
diff options
context:
space:
mode:
authorngicks <94618820+ngicks@users.noreply.github.com>2026-04-09 02:33:00 +0900
committerGitHub <noreply@github.com>2026-04-08 13:33:00 -0400
commita165eee64fa628045241b200d150b0f1e7737301 (patch)
treec4ab2de9e4e2cd927d0ffa420b7b20a5023f87a5 /runtime/lua/vim/version.lua
parent7e4d484c9dd24924f8d16012aa88aa7145f4d2a5 (diff)
downloadrneovim-a165eee64fa628045241b200d150b0f1e7737301.tar.gz
rneovim-a165eee64fa628045241b200d150b0f1e7737301.tar.bz2
rneovim-a165eee64fa628045241b200d150b0f1e7737301.zip
feat(vim.version): add __eq to vim.VersionRange #38881
Problem: vim.VersionRange had no __eq metamethod, so comparing 2 distinct but same value instances always returned false. In vim.pack.add this caused redundant lockfile rewrites, even when the resulting lockfile content was unchanged. Solution: Add __eq metamethod on vim.VersionRange
Diffstat (limited to 'runtime/lua/vim/version.lua')
-rw-r--r--runtime/lua/vim/version.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/lua/vim/version.lua b/runtime/lua/vim/version.lua
index e0e81c6861..cb78ee6760 100644
--- a/runtime/lua/vim/version.lua
+++ b/runtime/lua/vim/version.lua
@@ -273,6 +273,9 @@ end
local range_mt = {
__index = VersionRange,
+ __eq = function(self, other)
+ return self.to == other.to and self.from == other.from
+ end,
__tostring = function(self)
if not self.to then
return '>=' .. tostring(self.from)