From 0e5ff5c0ab6930190122df086db5e3f91d8b38b8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 29 Sep 2023 15:55:29 +0200 Subject: [PATCH] fix(format): wrap custom formatter with error handler --- lua/lazyvim/plugins/lsp/format.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/lsp/format.lua b/lua/lazyvim/plugins/lsp/format.lua index f862a8a7..6eb78d0d 100644 --- a/lua/lazyvim/plugins/lsp/format.lua +++ b/lua/lazyvim/plugins/lsp/format.lua @@ -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