mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-23 11:30:23 +10:00
Minor updates.
This commit is contained in:
@@ -53,7 +53,29 @@
|
||||
magit-diff-mode
|
||||
magit-stash-mode
|
||||
magit-status-mode))))
|
||||
'(display-buffer-same-window))))))
|
||||
'(display-buffer-same-window))
|
||||
|
||||
('(+magit--display-buffer-in-direction))))))
|
||||
|
||||
(defun +magit--display-buffer-in-direction (buffer alist)
|
||||
"`display-buffer-alist' handler that opens BUFFER in a direction.
|
||||
|
||||
This differs from `display-buffer-in-direction' in one way: it will try to use a
|
||||
window that already exists in that direction. It will split otherwise."
|
||||
(let ((direction (or (alist-get 'direction alist)
|
||||
+magit-open-windows-in-direction)))
|
||||
(if-let (window (window-in-direction direction))
|
||||
(select-window window)
|
||||
(if-let (window (window-in-direction
|
||||
(pcase direction
|
||||
(`right 'left)
|
||||
(`left 'right)
|
||||
((or `up `above) 'down)
|
||||
((or `down `below) 'up))))
|
||||
(select-window window)
|
||||
(split-window-horizontally)))
|
||||
(switch-to-buffer buffer)
|
||||
(selected-window)))
|
||||
|
||||
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user