mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-25 18:28:50 +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)
|
config = function(_, opts)
|
||||||
opts.formatters = opts.formatters or {}
|
opts.formatters = opts.formatters or {}
|
||||||
for f, o in pairs(opts.formatters) do
|
for name, formatter in pairs(opts.formatters) do
|
||||||
if type(o) ~= "function" then
|
if type(formatter) == "table" then
|
||||||
local ok, formatter = pcall(require, "conform.formatters." .. f)
|
local ok, defaults = pcall(require, "conform.formatters." .. name)
|
||||||
opts.formatters[f] = vim.tbl_deep_extend("force", {}, ok and formatter or {}, o)
|
if ok and type(defaults) == "table" then
|
||||||
|
opts.formatters[name] = vim.tbl_deep_extend("force", {}, defaults, formatter)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
require("conform").setup(opts)
|
require("conform").setup(opts)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue