Skip to content

fix: prevent balance-windows from resizing chat window#205

Merged
ericdallo merged 1 commit intoeditor-code-assistant:masterfrom
sata:sata-fix-balance-window
Apr 4, 2026
Merged

fix: prevent balance-windows from resizing chat window#205
ericdallo merged 1 commit intoeditor-code-assistant:masterfrom
sata:sata-fix-balance-window

Conversation

@sata
Copy link
Copy Markdown
Contributor

@sata sata commented Apr 3, 2026

Without this change, when running balance-windows, even if eca-chat window is a side window, it will try to balance it.

An alternative is to not use side window, but the implication then is, your chat constantly is resized when opening/closing buffers and running balance-windows

With this fix, your side window size is respected regardless of other buffers/windows.

Relates to #126

I'm not really a elisp coder, so I'm up for any changes to the few lines this change consist of.

Current version

broken

After applying patch

working

As title, without this change, when running `balance-windows`, even if
eca-chat window is a side window, it will try to balance it.

An alternative is to not use side window, but the implication then is,
your chat constantly is resized when opening/closing buffers.

With this fix, your side window size is respected regardless of other
buffers/windows.
@sata sata changed the title fix: prevent balance-windows from resizing chat fix: prevent balance-windows from resizing chat window Apr 3, 2026
Copy link
Copy Markdown
Member

@ericdallo ericdallo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any harm, looks good, thank you!

@ericdallo ericdallo merged commit 0cacb78 into editor-code-assistant:master Apr 4, 2026
15 checks passed
@ericdallo
Copy link
Copy Markdown
Member

@sata Actually I reverted that after relaizing this blocks user from change chat size even for when on side window (I myself use this all the time via enlarge-window function).
We should find a alternative way or you can do that only for yourself via a hook

@sata
Copy link
Copy Markdown
Contributor Author

sata commented Apr 4, 2026

@sata Actually I reverted that after relaizing this blocks user from change chat size even for when on side window (I myself use this all the time via enlarge-window function). We should find a alternative way or you can do that only for yourself via a hook

@ericdallo Ah! I didn't use that, but I see it doesn't work.

This works for me. Essentially wrapping a advice around balance-window, pinning window-size-fixed buffer local variable for any chat buffer then essentially unsetting it by going over the buffers it manipulated.

I'll give this a go for a few days and see how I get on. Became more complicated than I thought and also I'm not a huge fan of messing around with advices for general use. Perhaps there is a better way to do it 'as a standard' -- thought as a side window, it just doesn't seem right how balance-window behaves without this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants