summaryrefslogtreecommitdiff
path: root/lua/core/formatter.lua
diff options
context:
space:
mode:
authorchristianchiarulli <[email protected]>2021-07-13 01:08:03 -0400
committerchristianchiarulli <[email protected]>2021-07-13 01:08:03 -0400
commit359b6fd8e44bc2ad5088aada3f9c037fb85b19af (patch)
tree970a9169fa9838c4a6bb43eecdaeec841bf87710 /lua/core/formatter.lua
parenteceb656b4bdcd5bb4050c1e2566e95f97b99e20e (diff)
protected call for formatter.nvim
Diffstat (limited to 'lua/core/formatter.lua')
-rw-r--r--lua/core/formatter.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/lua/core/formatter.lua b/lua/core/formatter.lua
index 50dcb654..06fcb56d 100644
--- a/lua/core/formatter.lua
+++ b/lua/core/formatter.lua
@@ -48,8 +48,12 @@ end
-- end
-- end
-- end
+local status_ok, formatter = pcall(require, "formatter")
+if not status_ok then
+ return
+end
-require("formatter").setup {}
+formatter.setup {}
if not O.format_on_save then
vim.cmd [[if exists('#autoformat#BufWritePost')