branch: externals/ement
commit db2952d3226d2a59f0112ac13fa46cac5e259102
Author: Phil Sainty <[email protected]>
Commit: Phil Sainty <[email protected]>

    Prevent unwanted resizing when cycling through buffers in a window
    
    (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.
---
 ement-room.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/ement-room.el b/ement-room.el
index 00dfd960a3..73877154e6 100644
--- a/ement-room.el
+++ b/ement-room.el
@@ -4473,8 +4473,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)))

Reply via email to