fix(config): deepcopy config where needed

This commit is contained in:
Folke Lemaitre 2024-11-06 22:36:35 +01:00
parent 0d91a4e364
commit 6c76f91398
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 2 additions and 2 deletions

View file

@ -65,7 +65,7 @@ function M.config.get(snack, defaults, ...)
for i = 1, select("#", ...) do
local v = select(i, ...)
if v then
table.insert(merge, v)
table.insert(merge, vim.deepcopy(v))
end
end
return vim.tbl_deep_extend("force", unpack(merge))

View file

@ -130,7 +130,7 @@ function M.resolve(...)
local stack = { ... }
while #stack > 0 do
local next = table.remove(stack)
next = type(next) == "table" and next or Snacks.config.styles[next]
next = type(next) == "table" and next or vim.deepcopy(Snacks.config.styles[next])
---@cast next snacks.win.Config?
if next then
table.insert(merge, 1, next)