From 50b655d0f40449d834b864787462c02dc569785b Mon Sep 17 00:00:00 2001 From: Rutherther Date: Mon, 17 Jun 2024 08:26:11 +0200 Subject: [PATCH] fix: golden-ratio in ediff --- init.el | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index f8e58e0..189a0f8 100644 --- a/init.el +++ b/init.el @@ -442,6 +442,7 @@ :ensure t :custom (golden-ratio-exclude-buffer-regexp '("dape")) + (golden-ratio-exclude-modes '("ediff-mode")) ;; Work with evil (golden-ratio-extra-commands '( evil-window-left @@ -465,8 +466,23 @@ select-window-9)) ;; Work with which-key - (golden-ratio-inhibit-functions '((lambda () (and which-key--buffer - (window-live-p (get-buffer-window which-key--buffer)))))) + (golden-ratio-inhibit-functions '( + (lambda () (and which-key--buffer + (window-live-p (get-buffer-window which-key--buffer)))) + pl/ediff-comparison-buffer-p + )) + :hook + (ediff-startup . my-ediff-startup-hook) + :init + (defun my-ediff-startup-hook () + "Workaround to balance the ediff windows when golden-ratio is enabled." + ;; There's probably a better way to do it. + (ediff-toggle-split) + (ediff-toggle-split)) + + (defun pl/ediff-comparison-buffer-p () + (and (boundp 'ediff-this-buffer-ediff-sessions) + ediff-this-buffer-ediff-sessions)) :config (golden-ratio-mode 1) ) -- 2.48.1