mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
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:
@ -53,13 +53,16 @@
|
||||
"Clean up magit buffers after quitting `magit-status' and refresh version
|
||||
control in buffers."
|
||||
(interactive)
|
||||
(mapc #'+magit--kill-buffer (magit-mode-get-buffers))
|
||||
(dolist (buffer (buffer-list))
|
||||
(with-current-buffer buffer
|
||||
(when (fboundp 'vc-refresh-state)
|
||||
(vc-refresh-state))
|
||||
(when (fboundp '+version-control|update-git-gutter)
|
||||
(+version-control|update-git-gutter)))))
|
||||
(if (cdr (delq nil (mapcar (lambda (win) (with-selected-window win (eq major-mode 'magit-status-mode)))
|
||||
(window-list))))
|
||||
(quit-window)
|
||||
(mapc #'+magit--kill-buffer (magit-mode-get-buffers))
|
||||
(dolist (buffer (buffer-list))
|
||||
(with-current-buffer buffer
|
||||
(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)
|
||||
"TODO"
|
||||
|
Reference in New Issue
Block a user