@@ -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
@@ -529,7 +529,8 @@ MULTILINE-INPUT-SEQUENCE configures `S-<return>' and `C-<return>' when non-nil."
529529 (side . , side )
530530 (slot . 0 )
531531 ,@(when (memq side '(left right))
532- `((window-width . , ai-code-backends-infra-window-width )))
532+ `((window-width
533+ . ,#'ai-code-backends-infra--fit-side-window-body-width )))
533534 ,@(when (memq side '(top bottom))
534535 `((window-height . , ai-code-backends-infra-window-height )))
535536 (window-parameters . ((no-delete-other-windows . t )))))))
@@ -540,6 +541,13 @@ MULTILINE-INPUT-SEQUENCE configures `S-<return>' and `C-<return>' when non-nil."
540541 (select-window window))
541542 window))
542543
544+ (defun ai-code-backends-infra--fit-side-window-body-width (window )
545+ " Resize WINDOW so its body width matches `ai-code-backends-infra-window-width' ."
546+ (let ((delta (- ai-code-backends-infra-window-width
547+ (window-body-width window))))
548+ (unless (zerop delta)
549+ (window-resize window delta t ))))
550+
543551; ;; Session Helpers
544552
545553(defun ai-code-backends-infra--session-working-directory ()
0 commit comments