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
|
@ -47,14 +47,7 @@ available.")
|
|||
|
||||
;; Don't replace the leader key
|
||||
;; FIXME remove me when general.el is integrated
|
||||
(define-key magit-diff-mode-map (kbd doom-leader-key) nil)
|
||||
|
||||
(defun +magit|update-vc ()
|
||||
"Update vc in all verson-controlled buffers when magit refreshes."
|
||||
(dolist (buf (buffer-list))
|
||||
(with-current-buffer buf
|
||||
(vc-refresh-state))))
|
||||
(add-hook 'magit-post-refresh-hook #'+magit|update-vc))
|
||||
(define-key magit-diff-mode-map (kbd doom-leader-key) nil))
|
||||
|
||||
|
||||
(def-package! magit-todos
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue