tools/magit: update vc on +magit/quit
Instead of magit-post-refresh-hook, which fires much more frequently. Updating vc across all buffers is expensive, so let's only do it when we quit magit. Warning: this may make quitting magit expensive when you have many buffers open. Still searching for a better solution.
This commit is contained in:
parent
d9a179d071
commit
fcd1e913c5
2 changed files with 10 additions and 10 deletions
|
@ -50,9 +50,16 @@
|
|||
|
||||
;;;###autoload
|
||||
(defun +magit/quit (&optional _kill-buffer)
|
||||
"Clean up magit buffers after quitting `magit-status'."
|
||||
"Clean up magit buffers after quitting `magit-status' and refresh version
|
||||
control in buffers."
|
||||
(interactive)
|
||||
(mapc #'+magit--kill-buffer (magit-mode-get-buffers)))
|
||||
(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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue