CodeCompanionChat Close #1867
Closed
bdogabriel
started this conversation in
Enhancements
Replies: 1 comment 2 replies
-
function()
-- Ensure no CodeCompanion buffers are saved into the session
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
if vim.bo[buf].filetype == "codecompanion" then
vim.api.nvim_buf_delete(buf, { force = true })
end
end
end, FYI, see |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I don't know if this is a problem only with me, but if I quit
nvim
andcodecompanion
is open on a split, when I open the editor again, the buffer and the window are still there, but the chat itself is not functional anymore. So I need to always remember to closecodecompanion
before leavingnvim
, or I'll have to "clean the mess" when I reopen it.This is a minor annoyance, but could be easily solved with a
Close
command. But sinceClose
does not exist, I just use a floating window because it is on my face and there is no way I will forget to close it before leaving the editor.When I used
CopilotChat
, I had anautocmd
that closes it on "QuitPre", and it solved this exact same problem. But I cannot achieve this withcodecompanion
usingToggle
with anautocmd
: if the chat is not open when I closenvim
, it will open one, and then close, producing the same result.I couldn't find a workaround for this on the discussions/docs/issues, and I cannot figure it out myself due to skill issues. I know just enough of
lua
andnvim
to get a decent config working, I am still learning. But even if there is a workaround, I think it wouldn't be a bad Idea to have a separateClose
command (maybe aOpen
too), because it would enable more customization.I know there is no bug, and this is normal behavior. But it's just my motivation and example to show that adding a
Close
command could be beneficial to cover use cases whichToggle
can't.I hope this can be interesting for someone else :)
Beta Was this translation helpful? Give feedback.
All reactions