fix(format): wrap custom formatter with error handler

This commit is contained in:
Folke Lemaitre committed 2023-09-29 15:55:29 +02:00
1 parent 886d49eb89
commit 0e5ff5c0ab
1 file changed
+3 -1
+3 -1
View File
@@ -35,7 +35,9 @@ function M.format(opts)
return
end
if M.custom_format and M.custom_format(buf) then
if M.custom_format and Util.try(function()
M.custom_format(buf)
end, { msg = "Custom formatter failed" }) then
return
end