From a165eee64fa628045241b200d150b0f1e7737301 Mon Sep 17 00:00:00 2001 From: ngicks <94618820+ngicks@users.noreply.github.com> Date: Thu, 9 Apr 2026 02:33:00 +0900 Subject: 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 --- runtime/lua/vim/version.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/lua/vim/version.lua') 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) -- cgit