mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 17:58:51 +02:00
fix(conform): dont try merging function formatters. Fixes #1582
This commit is contained in:
parent
9f034ab106
commit
f4750859f2
1 changed files with 6 additions and 4 deletions
|
@ -43,10 +43,12 @@ return {
|
|||
},
|
||||
config = function(_, opts)
|
||||
opts.formatters = opts.formatters or {}
|
||||
for f, o in pairs(opts.formatters) do
|
||||
if type(o) ~= "function" then
|
||||
local ok, formatter = pcall(require, "conform.formatters." .. f)
|
||||
opts.formatters[f] = vim.tbl_deep_extend("force", {}, ok and formatter or {}, o)
|
||||
for name, formatter in pairs(opts.formatters) do
|
||||
if type(formatter) == "table" then
|
||||
local ok, defaults = pcall(require, "conform.formatters." .. name)
|
||||
if ok and type(defaults) == "table" then
|
||||
opts.formatters[name] = vim.tbl_deep_extend("force", {}, defaults, formatter)
|
||||
end
|
||||
end
|
||||
end
|
||||
require("conform").setup(opts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue