From d02f3d432aafdc9fe05dd2b71b71978c0bd21f57 Mon Sep 17 00:00:00 2001 From: Pierre Courtieu Date: Thu, 26 Apr 2007 19:00:16 +0000 Subject: Fixing auto shrink in coq three window mode, to avoid window disappearing. --- coq/coq.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/coq/coq.el b/coq/coq.el index 5e634dd3..564cfada 100644 --- a/coq/coq.el +++ b/coq/coq.el @@ -1617,13 +1617,17 @@ Only when three-buffer-mode is enabled." (> (frame-height) 10) (get-buffer-window proof-response-buffer)) (let ((curwin (selected-window)) - (maxhgth (- (window-height) window-min-height)) hgt-resp nline-resp) + ;; maxhgth is the max height of both resp and goals buffers to avoid + ;; make the other disappear + (maxhgth (- (window-height) window-min-height)) + hgt-resp nline-resp) (select-window (get-buffer-window proof-response-buffer)) (setq hgt-resp (window-height)) - (setq nline-resp - (min maxhgth (max window-min-height (count-lines (point-max) (point-min))))) + (setq nline-resp ; number of lines we want for response buffer + (min maxhgth (max window-min-height ; + 1 here for comfort + (+ 1 (count-lines (point-max) (point-min)))))) (unless (is-not-split-vertic (selected-window)) - (shrink-window (- hgt-resp (+ 1 nline-resp)))) + (shrink-window (- hgt-resp nline-resp))) (beginning-of-buffer) (recenter) (select-window curwin) -- cgit v1.2.3