From 069a6cc0c6b542abc42d881ba34b668b6bd0d462 Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Mon, 27 Apr 2026 17:46:01 +0200 Subject: [PATCH] fix(git): close commit proxy window before deleting its buffer --- lua/git/commit.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/git/commit.lua b/lua/git/commit.lua index c9fc87e..bec3bc3 100644 --- a/lua/git/commit.lua +++ b/lua/git/commit.lua @@ -61,12 +61,12 @@ function M.commit(opts) callback = done, }) end, function(result) + if proxy_win and vim.api.nvim_win_is_valid(proxy_win) then + pcall(vim.api.nvim_win_close, proxy_win, true) + end if proxy_buf and vim.api.nvim_buf_is_valid(proxy_buf) then vim.api.nvim_buf_delete(proxy_buf, { force = true }) end - if proxy_win and vim.api.nvim_win_is_valid(proxy_win) then - vim.api.nvim_win_close(proxy_win, true) - end if result.code ~= 0 then log.error("git commit failed: %s", vim.trim(result.stderr or "")) return