aboutsummaryrefslogtreecommitdiffstats
path: root/lua/conform/util.lua
diff options
context:
space:
mode:
authorSteven Arcangeli <506791+stevearc@users.noreply.github.com>2023-08-29 20:26:24 -0700
committerGitHub <noreply@github.com>2023-08-29 20:26:24 -0700
commit08dc913fb22d402a98d1d9733536f2876c6f6314 (patch)
treec702f095100a4c14a37071f4946d4a87b7687aae /lua/conform/util.lua
parent288068b1b78c79e64054ef443afbf6f2f5145da4 (diff)
feat: notify when formatter errors, and add notify_on_error config option (#16)
Diffstat (limited to 'lua/conform/util.lua')
-rw-r--r--lua/conform/util.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/lua/conform/util.lua b/lua/conform/util.lua
index d2ca1b9..d0856ab 100644
--- a/lua/conform/util.lua
+++ b/lua/conform/util.lua
@@ -91,4 +91,14 @@ M.tbl_slice = function(tbl, start_idx, end_idx)
return ret
end
+---@param cb fun(...)
+---@param wrapper fun(...)
+---@return fun(...)
+M.wrap_callback = function(cb, wrapper)
+ return function(...)
+ wrapper(...)
+ cb(...)
+ end
+end
+
return M