From f294af004f1dbcdf3a42efe3caade7fd6a53ef9e Mon Sep 17 00:00:00 2001 From: Pierre Courtieu Date: Wed, 25 Aug 2010 09:51:16 +0000 Subject: 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). --- generic/pg-response.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'generic/pg-response.el') 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) -- cgit v1.2.3