diff options
| author | Pierre Courtieu | 2010-08-25 09:51:16 +0000 |
|---|---|---|
| committer | Pierre Courtieu | 2010-08-25 09:51:16 +0000 |
| commit | f294af004f1dbcdf3a42efe3caade7fd6a53ef9e (patch) | |
| tree | a56d0bb83c41d2f7b5b8ea597c15b359b39259e1 | |
| parent | d8dcc5a9a4e4c8bf55b697f8a9a1f85fe1240356 (diff) | |
Fixed the bug of vertical window splitting when the size of the window
is too small. However if the frame is too small the bug remains (but
it is much less probable).
| -rw-r--r-- | generic/pg-response.el | 9 | ||||
| -rw-r--r-- | generic/proof-utils.el | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/generic/pg-response.el b/generic/pg-response.el index 1e022fdb..08ad827b 100644 --- a/generic/pg-response.el +++ b/generic/pg-response.el @@ -110,16 +110,21 @@ Internal variable, setting this will have no effect!") (defun proof-three-window-enable () (proof-layout-windows)) +(defun proof-safe-split-window-vertically () + (if (<= (window-height) (* 2 window-min-height)) + (enlarge-window (+ 3 (* 2 window-min-height)))) + (split-window-vertically)) + (defun proof-select-three-b (b1 b2 b3 &optional nohorizontalsplit) "Select three buffers. Put them into three windows, selecting the last one." (interactive "bBuffer1:\nbBuffer2:\nbBuffer3:") (delete-other-windows) (if nohorizontalsplit - (split-window-vertically) + (proof-safe-split-window-vertically) (split-window-horizontally)) (switch-to-buffer b1) (other-window 1) - (split-window-vertically) + (proof-safe-split-window-vertically) (switch-to-buffer b2) (other-window 1) (switch-to-buffer b3) diff --git a/generic/proof-utils.el b/generic/proof-utils.el index a20106b0..b211d6d6 100644 --- a/generic/proof-utils.el +++ b/generic/proof-utils.el @@ -258,7 +258,7 @@ NB: may change the selected window." (if (not (and proof-three-window-enable associated-windows)) (display-buffer buffer) (select-window (car associated-windows)) ; take on assoc. win - (split-window-vertically) + (proof-safe-split-window-vertically) (set-window-dedicated-p (selected-window) nil) (switch-to-buffer buffer) (set-window-dedicated-p (selected-window) t) |
