Skip to content

Commit

Permalink
fix(registry): reset registries state when setting registries (#1474)
Browse files Browse the repository at this point in the history
This should only be called once (during mason.nvim setup), but this fixes potential duplicate registry registration in
cases where it's called > 1 times.
  • Loading branch information
williamboman committed Aug 27, 2023
1 parent 3569827 commit c811fbf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lua/mason-registry/sources/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ local registries = {}

---@param registry_ids string[]
function M.set_registries(registry_ids)
registries = {}
for _, registry in ipairs(registry_ids) do
local ok, err = pcall(function()
table.insert(registries, parse(registry))
Expand Down

0 comments on commit c811fbf

Please sign in to comment.