3 ms·
I basically just slightly modified the code in ediff-setup-windows-plain-merge from ediff-wind.el. Not too sure how to paste code on HN, here's the modified ve
by TacticalCoder 4y ago
I basically just slightly modified the code in ediff-setup-windows-plain-merge from ediff-wind.el.
Not too sure how to paste code on HN, here's the modified version which works for me. The orginal ediff-setup-windows-plain-merge may depend on your Emacs version though, so buyer beware (things may have changed and need to be revisited).
Instead of showing:
A B
C D
Ediff control panel
I show:
A B C
D
Ediff control panel
As for Git AFAICT all I have is git config --global merge.conflictStyle diff3.
Compare it to your version of ediff-setup-windows-plain-merge to see what I changed:
(defun ediff-setup-windows-plain-merge (buf-A buf-B buf-C control-buffer)
;; skip dedicated and unsplittable frames
(ediff-destroy-control-frame control-buffer)
(let ((window-min-height 1)
(with-Ancestor-p (with-current-buffer control-buffer
ediff-merge-with-ancestor-job))
split-window-function
merge-window-share merge-window-lines
(buf-Ancestor (with-current-buffer control-buffer
ediff-ancestor-buffer))
wind-A wind-B wind-C wind-Ancestor)
(with-current-buffer control-buffer
(setq merge-window-share ediff-merge-window-share
;; this lets us have local versions of ediff-split-window-function
split-window-function ediff-split-window-function))
(delete-other-windows)
(set-window-dedicated-p (selected-window) nil)
(split-window-vertically)
(ediff-select-lowest-window)
(ediff-setup-control-buffer control-buffer)
;; go to the upper window and split it betw A, B, and possibly C
(other-window 1)
(setq merge-window-lines
(max 2 (round (* (window-height) merge-window-share))))
(switch-to-buffer buf-A)
(setq wind-A (selected-window))
(split-window-vertically (max 2 (- (window-height) merge-window-lines)))
(if (eq (selected-window) wind-A)
(other-window 1))
(setq wind-C (selected-window))
(switch-to-buffer buf-C)
(select-window wind-A)
(funcall split-window-function)
(if (eq (selected-window) wind-A)
(other-window 1))
(switch-to-buffer buf-B)
(setq wind-B (selected-window))
(when (and ediff-show-ancestor with-Ancestor-p)
(select-window wind-B)
(split-window-horizontally)
(when (eq (selected-window) wind-B)
(other-window 1))
(switch-to-buffer buf-Ancestor)
(setq wind-Ancestor (selected-window)))
(balance-windows-area)
(with-current-buffer control-buffer
(setq ediff-window-A wind-A
ediff-window-B wind-B
ediff-window-C wind-C
ediff-window-Ancestor wind-Ancestor))
(ediff-select-lowest-window)
(minimize-window)
(ediff-setup-control-buffer control-buffer)
))
- Icathian 4y agoAwesome, I'll play with this a bunch on Monday. Thank you!