emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/golden-ratio 7215ffcc56 77/95: Don't shrink selected windo


From: ELPA Syncer
Subject: [nongnu] elpa/golden-ratio 7215ffcc56 77/95: Don't shrink selected window
Date: Thu, 7 Sep 2023 22:02:15 -0400 (EDT)

branch: elpa/golden-ratio
commit 7215ffcc5664fca3af0d678b383bf83da1add1ae
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    Don't shrink selected window
    
    * golden-ratio.el (golden-ratio--resize-window): Update.
    
    Shrinking selected window may result in enlarging a window that was
    supposed to be ignored.
---
 golden-ratio.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/golden-ratio.el b/golden-ratio.el
index f75184b185..8d9dc9c5e1 100644
--- a/golden-ratio.el
+++ b/golden-ratio.el
@@ -115,9 +115,14 @@ will not cause the window to be resized to the golden 
ratio."
   (with-selected-window (or window (selected-window))
     (let ((nrow  (floor (- (first  dimensions) (window-height))))
           (ncol  (floor (- (second dimensions) (window-width)))))
-      (when (window-resizable-p (selected-window) nrow)
+      (when (and
+             (window-resizable-p (selected-window) nrow)
+             ;; don't enlarge ignored windows
+             (> nrow 0))
         (enlarge-window nrow))
-      (when (window-resizable-p (selected-window) ncol t)
+      (when (and (window-resizable-p (selected-window) ncol t)
+                 ;; don't enlarge ignored windows
+                 (> ncol 0))
         (enlarge-window ncol t)))))
 
 (defun golden-ratio-exclude-major-mode-p ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]