From 1c35bad1dbd7c7fb0fb005d085739c3295dd9d55 Mon Sep 17 00:00:00 2001 From: WeariTraveller <70891059+WeariTraveller@users.noreply.github.com> Date: Fri, 20 Oct 2023 20:48:10 +0800 Subject: [PATCH] Delete the terminal before deleting the buffer --- lua/toggleterm/terminal.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/toggleterm/terminal.lua b/lua/toggleterm/terminal.lua index e4a154cd..1ad3ce4f 100644 --- a/lua/toggleterm/terminal.lua +++ b/lua/toggleterm/terminal.lua @@ -151,7 +151,7 @@ end ---Terminal buffer autocommands ---@param term Terminal local function setup_buffer_autocommands(term) - api.nvim_create_autocmd("TermClose", { + api.nvim_create_autocmd("BufDelete", { buffer = term.bufnr, group = AUGROUP, callback = function() delete(term.id) end,