Skip to content

Commit

Permalink
fix(conform): dont try to merge formatter functions
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 4, 2023
1 parent 2f16a7b commit 9f034ab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/lazyvim/plugins/extras/formatting/conform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ return {
config = function(_, opts)
opts.formatters = opts.formatters or {}
for f, o in pairs(opts.formatters) do
local ok, formatter = pcall(require, "conform.formatters." .. f)
opts.formatters[f] = vim.tbl_deep_extend("force", {}, ok and formatter or {}, o)
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)
end
end
require("conform").setup(opts)
end,
Expand Down

0 comments on commit 9f034ab

Please sign in to comment.