fix(git): close commit proxy window before deleting its buffer
This commit is contained in:
+3
-3
@@ -61,12 +61,12 @@ function M.commit(opts)
|
|||||||
callback = done,
|
callback = done,
|
||||||
})
|
})
|
||||||
end, function(result)
|
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
|
if proxy_buf and vim.api.nvim_buf_is_valid(proxy_buf) then
|
||||||
vim.api.nvim_buf_delete(proxy_buf, { force = true })
|
vim.api.nvim_buf_delete(proxy_buf, { force = true })
|
||||||
end
|
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
|
if result.code ~= 0 then
|
||||||
log.error("git commit failed: %s", vim.trim(result.stderr or ""))
|
log.error("git commit failed: %s", vim.trim(result.stderr or ""))
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user