From 65a5e50d1c5d88e5407934213257dd1c0bd73f7a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 25 Mar 2025 17:33:02 -0400 Subject: [PATCH] fix(magit): transient: window config jank With the combination of a bad value for `transient-display-buffer-action` and a non-nil `transient-show-during-minibuffer-read`, transient may jumble up adjacent popup/side windows, particularly those belonging to plugins with their own popup management and dedicated side windows (i.e. `display-buffer-alist` rules) like Helm or Doom's popups. Fix: #8319 Fix: #8235 Co-authored-by: tarsius --- modules/tools/magit/config.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/tools/magit/config.el b/modules/tools/magit/config.el index f023d1fdb..8cc62947c 100644 --- a/modules/tools/magit/config.el +++ b/modules/tools/magit/config.el @@ -83,11 +83,20 @@ Only has an effect in GUI Emacs.") ;; screen are opened as popups. ;; 2. The status screen isn't buried when viewing diffs or logs from the ;; status screen. - (setq transient-display-buffer-action '(display-buffer-below-selected) - transient-show-during-minibuffer-read t - magit-display-buffer-function #'+magit-display-buffer-fn + (setq magit-display-buffer-function #'+magit-display-buffer-fn magit-bury-buffer-function #'magit-mode-quit-window) + ;; Pop up transient windows at the bottom of the window where it was invoked. + ;; This is more ergonomic for users with large displays or many splits. + (setq transient-display-buffer-action + '(display-buffer-below-selected + (dedicated . t) + (inhibit-same-window . t)) + transient-show-during-minibuffer-read t) + (set-popup-rule! "^\\(?:\\*magit\\|magit:\\| \\*transient\\*\\)" :ignore t) + + ;; The mode-line isn't useful in these popups and take up valuable screen + ;; estate, so free it up. (add-hook 'magit-popup-mode-hook #'hide-mode-line-mode) ;; Add additional switches that seem common enough