From 9e0e586dd8c0cd93a31e1b5ef8e0294cde6e5cc8 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 19 Aug 2018 01:13:45 +0200 Subject: [PATCH] tools/magit: use current window instead of fullcol Full column is a bit tempermental. This also removes the need to restore the window config after quitting magit. Why the switch from full-frame magit to current-buffer? It is the least intrusive policy; it doesn't rearrange the user's workspace. --- modules/tools/magit/autoload.el | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/tools/magit/autoload.el b/modules/tools/magit/autoload.el index 3d0d44e04..ae0159869 100644 --- a/modules/tools/magit/autoload.el +++ b/modules/tools/magit/autoload.el @@ -21,16 +21,17 @@ (derived-mode-p 'magit-mode)) (let ((size (cond ((eq buffer-mode 'magit-process-mode) 0.35) ((bound-and-true-p git-commit-mode) 0.7) - (t 0.9)))) - `(display-buffer-below-selected . ((window-height . ,size))))) + (0.9)))) + `(display-buffer-below-selected + . ((window-height . ,(truncate (* (window-height) size))))))) ;; log/stash/process buffers, unless opened from a magit-status ;; window, should be opened in popups. ((memq buffer-mode '(magit-process-mode magit-log-mode magit-stash-mode)) - '(display-buffer-in-side-window)) - ;; Last resort: plain old fullcolumn. - ('(magit--display-buffer-fullcolumn)))))) + '(display-buffer-below-selected)) + ;; Last resort: use current window + ('(display-buffer-same-window)))))) ;;;###autoload (defun +magit-display-popup-buffer (buffer &optional alist) @@ -52,9 +53,7 @@ (defun +magit/quit (&optional _kill-buffer) "Clean up magit buffers after quitting `magit-status'." (interactive) - (let ((buffers (magit-mode-get-buffers))) - (magit-restore-window-configuration) - (mapc #'+magit--kill-buffer buffers))) + (mapc #'+magit--kill-buffer (magit-mode-get-buffers))) (defun +magit--kill-buffer (buf) "TODO"