Implement fullscreen magit status without advices

This commit is contained in:
Jonas Bernoulli 2015-06-27 10:44:30 +02:00 committed by syl20bnr
parent e923ae7fb7
commit 5df4ba0e75

View file

@ -87,17 +87,11 @@
;; full screen magit-status
(when git-magit-status-fullscreen
(defadvice magit-status (around magit-fullscreen activate)
(window-configuration-to-register :magit-fullscreen)
ad-do-it
(delete-other-windows))
(defun magit-quit-session ()
"Restores the previous window configuration and kills the magit buffer"
(interactive)
(kill-buffer)
(jump-to-register :magit-fullscreen))
(define-key magit-status-mode-map (kbd "q") 'magit-quit-session))
(setq magit-restore-window-configuration t)
(setq magit-status-buffer-switch-function
(lambda (buffer)
(pop-to-buffer buffer)
(delete-other-windows))))
(defun magit-toggle-whitespace ()
(interactive)