mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user