Repository navigation
Replies: 2 comments
|
Sorted out the width issue with this configuration if we do not resize the window: require("codecompanion").setup({
display = {
chat = {
window = {
-- 0 means auto
width = 0,
height = 0,
-- This fixes issue with auto-width (open CC Chat as third split)
full_height = false,
...and this autocommand in case we change the size and want it to stick: -- Save the windows dimensions
local cc_win = require("codecompanion.config").display.chat.window
vim.api.nvim_create_autocmd("WinResized", {
callback = function()
for _, winid in ipairs(vim.v.event.windows or {}) do
if vim.api.nvim_win_is_valid(winid) then
local buf = vim.api.nvim_win_get_buf(winid)
if vim.bo[buf].filetype == "codecompanion" then
cc_win.width = vim.api.nvim_win_get_width(winid)
cc_win.height = vim.api.nvim_win_get_height(winid)
end
end
end
end,
}) |
0 replies
|
There is a #3344 which is solving a similar issue, but with much deeper changes. |
0 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.
Uh oh!
There was an error while loading. Please reload this page.
When I have more than one codecompanion AI chats and I resize the window to width like
70%, then switch to the other chat using][- the window resizes back to the default width. I have set thedisplay.chat.windows.width = 0, but that does not help. The expected behavior would be that it does not resize, as I explicitly have set a different size. Like if I change one buffer to another, the size does not change.All reactions