branch: elpa/golden-ratio
commit 7215ffcc5664fca3af0d678b383bf83da1add1ae
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
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 ()