diff options
author | christianchiarulli <[email protected]> | 2021-07-13 01:08:03 -0400 |
---|---|---|
committer | christianchiarulli <[email protected]> | 2021-07-13 01:08:03 -0400 |
commit | 359b6fd8e44bc2ad5088aada3f9c037fb85b19af (patch) | |
tree | 970a9169fa9838c4a6bb43eecdaeec841bf87710 /lua/core/formatter.lua | |
parent | eceb656b4bdcd5bb4050c1e2566e95f97b99e20e (diff) |
protected call for formatter.nvim
Diffstat (limited to 'lua/core/formatter.lua')
-rw-r--r-- | lua/core/formatter.lua | 6 |
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') |