Skip to content

Commit

Permalink
Update code to show magit buffers in full screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Bar Magal committed Oct 17, 2015
1 parent cdea571 commit ade75ef
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions layers/+source-control/git/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,31 @@

;; full screen magit-status
(when git-magit-status-fullscreen
(setq magit-restore-window-configuration t)
(setq magit-status-buffer-switch-function
(setq magit-display-buffer-function
(lambda (buffer)
(pop-to-buffer buffer)
(delete-other-windows))))
(if (or
;; the original should stay alive, so we can't go fullscreen
magit-display-buffer-noselect
;; don't go fullscreen for certain magit buffers if current
;; buffer is a magit buffer (we're conforming to
;; `magit-display-buffer-traditional')
(and (derived-mode-p 'magit-mode)
(not (memq (with-current-buffer buffer major-mode)
'(magit-process-mode
magit-revision-mode
magit-diff-mode
magit-stash-mode
magit-status-mode)))))
;; open buffer according to original magit rules
(magit-display-buffer-traditional buffer)
;; open buffer in fullscreen
(delete-other-windows)
;; make sure the window isn't dedicated, otherwise
;; `set-window-buffer' throws an error
(set-window-dedicated-p nil nil)
(set-window-buffer nil buffer)
;; return buffer's window
(get-buffer-window buffer)))))

;; rebase mode
(evil-leader/set-key-for-mode 'git-rebase-mode
Expand Down

0 comments on commit ade75ef

Please sign in to comment.