From 8cbe130c6310b1e4a313ec7e611f534c3175d1e8 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Tue, 17 Mar 2026 09:49:07 +0900 Subject: modified plugins/goyo.lua --- ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/goyo.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/goyo.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/goyo.lua index 86b9a03..dda358b 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/goyo.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/goyo.lua @@ -33,6 +33,24 @@ return { ":Goyo|q!", { noremap = true, silent = true, desc = "Goyo abort" } ) + -- Goyo creates multiple padding windows. + -- Use a global (non-buffer-local) QuitPre so it fires regardless of which window is active. + local mutt_quit_group = vim.api.nvim_create_augroup("TheSiahxyz_mutt_quit", { clear = true }) + vim.api.nvim_create_autocmd("QuitPre", { + group = mutt_quit_group, + once = true, + callback = function() + vim.cmd("qa!") + end, + }) + -- Clean up the global QuitPre if the buffer is deleted without quitting + vim.api.nvim_create_autocmd("BufDelete", { + buffer = 0, + once = true, + callback = function() + pcall(vim.api.nvim_del_augroup_by_id, mutt_quit_group) + end, + }) end, }) end, -- cgit v1.2.3