quit-window on multiple magit-status windows
If you accidentally open multiple magit status windows, you'll be stuck in a deadlock, where `q` will do nothing. Now, +magit/quit will use `quit-window` on excess magit-status windows instead.
This commit is contained in:
parent
0312f8656a
commit
b573fcce20
1 changed files with 10 additions and 7 deletions
|
@ -53,13 +53,16 @@
|
||||||
"Clean up magit buffers after quitting `magit-status' and refresh version
|
"Clean up magit buffers after quitting `magit-status' and refresh version
|
||||||
control in buffers."
|
control in buffers."
|
||||||
(interactive)
|
(interactive)
|
||||||
(mapc #'+magit--kill-buffer (magit-mode-get-buffers))
|
(if (cdr (delq nil (mapcar (lambda (win) (with-selected-window win (eq major-mode 'magit-status-mode)))
|
||||||
(dolist (buffer (buffer-list))
|
(window-list))))
|
||||||
(with-current-buffer buffer
|
(quit-window)
|
||||||
(when (fboundp 'vc-refresh-state)
|
(mapc #'+magit--kill-buffer (magit-mode-get-buffers))
|
||||||
(vc-refresh-state))
|
(dolist (buffer (buffer-list))
|
||||||
(when (fboundp '+version-control|update-git-gutter)
|
(with-current-buffer buffer
|
||||||
(+version-control|update-git-gutter)))))
|
(when (fboundp 'vc-refresh-state)
|
||||||
|
(vc-refresh-state))
|
||||||
|
(when (fboundp '+version-control|update-git-gutter)
|
||||||
|
(+version-control|update-git-gutter))))))
|
||||||
|
|
||||||
(defun +magit--kill-buffer (buf)
|
(defun +magit--kill-buffer (buf)
|
||||||
"TODO"
|
"TODO"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue