mirror of
https://github.com/neovim/neovim.git
synced 2026-04-17 21:12:51 +00:00
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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user