Emacs: Add purpose-support to magit-workaround.
This commit is contained in:
parent
36c1ab5183
commit
0d6b6a3f86
|
@ -1,6 +1,6 @@
|
||||||
;;; git.el --- magit and stuff. -*- lexical-binding: t; -*-
|
;;; git.el --- magit and stuff. -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Time-stamp: <2020-01-27T02:06:44+0100>
|
;; Time-stamp: <2020-01-27T05:28:52+0100>
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
|
||||||
|
@ -25,16 +25,17 @@
|
||||||
(magit-diff-refine-hunk 'all) ; Show word-granularity differences.
|
(magit-diff-refine-hunk 'all) ; Show word-granularity differences.
|
||||||
|
|
||||||
:config
|
:config
|
||||||
|
;; <https://github.com/magit/magit/issues/4034>
|
||||||
(defun my/magit-display-buffer (buffer)
|
(defun my/magit-display-buffer (buffer)
|
||||||
"Workaround to ensure that BUFFER is split vertically if necessary."
|
"Workaround to ensure that BUFFER is split vertically if necessary."
|
||||||
(if (and git-commit-mode
|
(if (and git-commit-mode
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(derived-mode-p 'magit-diff-mode)))
|
(derived-mode-p 'magit-diff-mode)))
|
||||||
(display-buffer buffer '((display-buffer-pop-up-window
|
(purpose--action-function buffer '((display-buffer-pop-up-window
|
||||||
display-buffer-use-some-window
|
display-buffer-use-some-window
|
||||||
display-buffer-below-selected)
|
display-buffer-below-selected)
|
||||||
(inhibit-same-window . t)))
|
(inhibit-same-window . t))))
|
||||||
(magit-display-buffer-traditional buffer)))
|
(magit-display-buffer-traditional buffer))
|
||||||
(setq magit-display-buffer-function #'my/magit-display-buffer)
|
(setq magit-display-buffer-function #'my/magit-display-buffer)
|
||||||
|
|
||||||
:bind
|
:bind
|
||||||
|
|
Loading…
Reference in New Issue
Block a user