Skip to content

Commit

Permalink
fix(picker.config): allow merging list-like layouts with table layout…
Browse files Browse the repository at this point in the history
… options
  • Loading branch information
folke committed Jan 17, 2025
1 parent f609b84 commit 706b1ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/snacks/picker/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ function M.layout(opts)
end
local preset = M.resolve(layout.preset or "custom", opts.source)
local ret = vim.deepcopy(opts.layouts and opts.layouts[preset] or layouts[preset] or {})
ret = Snacks.config.merge(ret, layout)
-- NOTE: use deep extend instead of merge to allow merging list-like tables
ret = vim.tbl_deep_extend("force", ret, layout)
ret.preset = nil
return ret
end
Expand Down

0 comments on commit 706b1ab

Please sign in to comment.