>From ddb8cda5b0c21807c884b9e5a72b0da7ee9605a2 Mon Sep 17 00:00:00 2001 From: Trust me I am a doctor Date: Tue, 29 Jun 2021 19:22:04 +0200 Subject: [PATCH] Fix ediff3 with window-combinaison-resize * lisp/vc/ediff-wind.el (ediff-setup-windows-plain-compare): When 'window-combination-resize' is set to t and 'even-window-sizes' is set to nil, the 3 window layout as in ediff3 does not produce a balanced layout. Getting rid of the manual resizing and relying rather on window.el to automatically resize the windows with 'window-combination-resize', solve that issue. (ediff-setup-windows-multiframe-compare): Tiddo. --- lisp/vc/ediff-wind.el | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el index fc6ea944ae..361eecd01e 100644 --- a/lisp/vc/ediff-wind.el +++ b/lisp/vc/ediff-wind.el @@ -400,7 +400,8 @@ ediff-setup-windows-plain-compare ;; skip dedicated and unsplittable frames (ediff-destroy-control-frame control-buffer) (let ((window-min-height 1) - split-window-function wind-width-or-height + (window-combination-resize t) + split-window-function three-way-comparison wind-A-start wind-B-start wind-A wind-B wind-C) (with-current-buffer control-buffer @@ -427,14 +428,7 @@ ediff-setup-windows-plain-compare (other-window 1) (switch-to-buffer buf-A) (setq wind-A (selected-window)) - (if three-way-comparison - (setq wind-width-or-height - (/ (if (eq split-window-function #'split-window-vertically) - (window-height wind-A) - (window-width wind-A)) - 3))) - - (funcall split-window-function wind-width-or-height) + (funcall split-window-function) (if (eq (selected-window) wind-A) (other-window 1)) @@ -443,7 +437,7 @@ ediff-setup-windows-plain-compare (if three-way-comparison (progn - (funcall split-window-function) ; equally + (funcall split-window-function) (if (eq (selected-window) wind-B) (other-window 1)) (switch-to-buffer buf-C) @@ -746,6 +740,7 @@ ediff-setup-windows-multiframe-compare (and (not (frame-live-p frame-A)) (or ctl-frame-exists-p (eq frame-B (selected-frame)))))) + (window-combination-resize t) wind-A-start wind-B-start designated-minibuffer-frame) @@ -758,7 +753,7 @@ ediff-setup-windows-multiframe-compare 'B ediff-narrow-bounds)))) (if use-same-frame - (let (wind-width-or-height) ; this affects 3way setups only + (progn (if (and (eq frame-A frame-B) (frame-live-p frame-A)) (select-frame frame-A) ;; avoid dedicated and non-splittable windows @@ -767,15 +762,7 @@ ediff-setup-windows-multiframe-compare (switch-to-buffer buf-A) (setq wind-A (selected-window)) - (if three-way-comparison - (setq wind-width-or-height - (/ - (if (eq split-window-function #'split-window-vertically) - (window-height wind-A) - (window-width wind-A)) - 3))) - - (funcall split-window-function wind-width-or-height) + (funcall split-window-function) (if (eq (selected-window) wind-A) (other-window 1)) (switch-to-buffer buf-B) -- 2.20.1