Skip to content

Commit

Permalink
Prevent unwanted resizing when cycling through buffers in a window
Browse files Browse the repository at this point in the history
(ement-room-compose-buffer-window-auto-height): Do not resize a window
which has just switched from some other buffer to a compose buffer, as
we may in fact be in the middle of cycling through the available
buffers, in which case it would be annoying for the window to suddenly
change size along the way.
  • Loading branch information
Phil Sainty committed Mar 31, 2024
1 parent 01e1999 commit dfef961
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ement-room.el
Original file line number Diff line number Diff line change
Expand Up @@ -4472,8 +4472,15 @@ Called via `post-command-hook' if option
;; so a more comprehensive solution, while possible, is not worth the added
;; complexity -- our relatively simplistic approach is good enough for the
;; vast majority of situations.

;; Skip resizing if we are being called recursively...
(unless (or (bound-and-true-p ement-room-compose-buffer-window-auto-height-resizing-p)
(window-full-height-p))
;; ...or there are no other windows to resize...
(window-full-height-p)
;; ...or we have just switched to this buffer from another buffer
;; (we may be cycling window buffers, and about to switch again).
(and (window-old-buffer)
(not (eq (window-old-buffer) (current-buffer)))))
;; Manipulate the window body height.
(let* ((pixelwise (and ement-room-compose-buffer-window-auto-height-pixelwise
(display-graphic-p)))
Expand Down

0 comments on commit dfef961

Please sign in to comment.