@@ -62,7 +62,7 @@ Can be either `vterm' or `eat'."
6262 :group 'ai-code-backends-infra )
6363
6464(defcustom ai-code-backends-infra-window-width 90
65- " Width of the side window when opened on left or right."
65+ " Body width of the side window when opened on left or right."
6666 :type 'integer
6767 :group 'ai-code-backends-infra )
6868
@@ -521,7 +521,8 @@ MULTILINE-INPUT-SEQUENCE configures `S-<return>' and `C-<return>' when non-nil."
521521 (side . , side )
522522 (slot . 0 )
523523 ,@(when (memq side '(left right))
524- `((window-width . , ai-code-backends-infra-window-width )))
524+ `((window-width
525+ . ,#'ai-code-backends-infra--fit-side-window-body-width )))
525526 ,@(when (memq side '(top bottom))
526527 `((window-height . , ai-code-backends-infra-window-height )))
527528 (window-parameters . ((no-delete-other-windows . t )))))))
@@ -532,6 +533,13 @@ MULTILINE-INPUT-SEQUENCE configures `S-<return>' and `C-<return>' when non-nil."
532533 (select-window window))
533534 window))
534535
536+ (defun ai-code-backends-infra--fit-side-window-body-width (window )
537+ " Resize WINDOW so its body width matches `ai-code-backends-infra-window-width' ."
538+ (let ((delta (- ai-code-backends-infra-window-width
539+ (window-body-width window))))
540+ (unless (zerop delta)
541+ (window-resize window delta t ))))
542+
535543; ;; Session Helpers
536544
537545(defun ai-code-backends-infra--session-working-directory ()
0 commit comments