fix(format): wrap custom formatter with error handler

This commit is contained in:
Folke Lemaitre 2023-09-29 15:55:29 +02:00
parent 886d49eb89
commit 0e5ff5c0ab
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

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