diff --git a/config/nvim/lua/fschauen/plugins/formatter.lua b/config/nvim/lua/fschauen/plugins/formatter.lua index 5cb5b51..5f50483 100644 --- a/config/nvim/lua/fschauen/plugins/formatter.lua +++ b/config/nvim/lua/fschauen/plugins/formatter.lua @@ -23,14 +23,11 @@ end local toggle_format_on_write = (function() local augroup_id = nil - local verbose = false -- Don't notify on first call. return function() if augroup_id then vim.api.nvim_del_augroup_by_id(augroup_id) augroup_id = nil - if verbose then - vim.notify("Format on write DISABLED", vim.log.levels.WARN) - end + vim.notify("Format on write DISABLED", vim.log.levels.WARN) else augroup_id = vim.api.nvim_create_augroup("fschauen.format_on_write", { clear = true }) vim.api.nvim_create_autocmd("BufWritePost", { @@ -39,16 +36,11 @@ local toggle_format_on_write = (function() pattern = "*", command = ":FormatWrite", }) - if verbose then - vim.notify("Format on write enabled", vim.log.levels.INFO) - end + vim.notify("Format on write enabled", vim.log.levels.INFO) end - verbose = true -- Notify from second call on. end end)() -toggle_format_on_write() -- Enable by default. - return { "mhartington/formatter.nvim",