* lisp/window.el (fit-window-to-buffer): Fix width calculation

When PIXELWISE is nil, we still calculate width in pixels and
then convert it to columns.  However, part of the calculation
was using columns where it should have used pixels.  (Bug#70894)
This commit is contained in:
Morgan Smith 2024-05-12 09:19:30 -04:00 committed by Eli Zaretskii
parent 5216903ae6
commit 42d444114d

View file

@ -9906,8 +9906,8 @@ accessible position."
;; the bottom is wider than the window.
(* (window-body-height window pixelwise)
(if pixelwise 1 char-height))))
(- total-width
(window-body-width window pixelwise)))))
(- (* total-width (if pixelwise 1 char-width))
(window-body-width window t)))))
(unless pixelwise
(setq width (/ (+ width char-width -1) char-width)))
(setq width (max min-width (min max-width width)))