diff options
| author | David Aspinall | 2002-09-11 15:07:44 +0000 |
|---|---|---|
| committer | David Aspinall | 2002-09-11 15:07:44 +0000 |
| commit | e06e8f52c43c2dbbc9c9ea6475553ceee9af1c08 (patch) | |
| tree | fd0a15ef552c5bd45ee57f295c4ca1d23f3f7690 | |
| parent | 2485896dae1ef3bbd5a8f83fc16f91c0adf4a22c (diff) | |
Attempt to improve window shrinking. Still needs work.
| -rw-r--r-- | generic/proof-utils.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/generic/proof-utils.el b/generic/proof-utils.el index 62db762d..d76c4f1f 100644 --- a/generic/proof-utils.el +++ b/generic/proof-utils.el @@ -587,8 +587,9 @@ or if the window is the only window of its frame." (mini (frame-property (window-frame window) 'minibuffer)) ;; Direction of resizing based on whether max position is visible. (expand (not (pos-visible-in-window-p test-pos window))) - ;; Most window is allowed to grow (or shrink) - (max-height (/ (frame-height (window-frame window)) 2))) + ;; Most window is allowed to grow to + (max-height (/ (frame-height (window-frame window)) + (if proof-three-window-mode 3 2)))) (if (and (< 1 (let ((frame (selected-frame))) (select-frame (window-frame window)) (unwind-protect @@ -612,12 +613,16 @@ or if the window is the only window of its frame." (< n max-height)) (shrink-window (if expand -1 1) nil window) (setq n (1+ n)))) - (if (and (> n 0) (not expand)) + (if (and (not expand) + ;; attempt to get some stability: only shrink if + ;; we're more than two lines too big. + (> n 2)) (shrink-window (min (1- n) (- (window-height window) (1+ window-min-height))) nil window) + ;; Always expand the window if necessary. (shrink-window (- n)))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
