Skip to content

Commit

Permalink
fix: when you close a chat buffer, cancel the request
Browse files Browse the repository at this point in the history
  • Loading branch information
olimorris committed Feb 27, 2024
1 parent 1e10d37 commit 90650b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/codecompanion/strategy/chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ local function chat_autocmds(bufnr, args)

_G.codecompanion_chats[bufnr] = nil

vim.api.nvim_buf_delete(bufnr, { force = true })
_G.codecompanion_jobs[request.data.buf].handler:shutdown()
vim.api.nvim_exec_autocmds("User", { pattern = "CodeCompanionRequest", data = { status = "finished" } })
vim.api.nvim_buf_delete(request.data.buf, { force = true })
end,
})
end
Expand Down

0 comments on commit 90650b0

Please sign in to comment.