From 15ff2a11f1c2a05953a802052ecaae1d7cf97d24 Mon Sep 17 00:00:00 2001 From: tiyn <43725244+tiyn@users.noreply.github.com> Date: Wed, 3 Jan 2024 01:06:31 +0100 Subject: [PATCH] Change BufWritePre to BufLeave --- lua/tidy/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/tidy/init.lua b/lua/tidy/init.lua index 20290bf..4d46829 100644 --- a/lua/tidy/init.lua +++ b/lua/tidy/init.lua @@ -57,7 +57,7 @@ function M.setup(opts) local tidy_grp = vim.api.nvim_create_augroup("tidy", { clear = true }) - vim.api.nvim_create_autocmd("BufWritePre", { + vim.api.nvim_create_autocmd("BufLeave", { group = tidy_grp, callback = function() if not M.enabled or is_excluded_ft(opts) or (vim.b.editorconfig ~= nil and not vim.tbl_isempty(vim.b.editorconfig)) then