Delete doom-modeline-magit-post-refresh due to the performance issue.

Workaround:
Revert the buffers manually.
(setq auto-revert-check-vc-info t) brings the same performance issue.

Refer to:
https://github.com/magit/magit/issues/2687
https://magit.vc/manual/magit/The-mode_002dline-information-isn_0027t-always-up_002dto_002ddate.html
This commit is contained in:
Vincent Zhang 2018-09-21 00:40:48 +08:00
parent 32963f4d29
commit 3d8e81b7e1

View file

@ -688,18 +688,6 @@ directory, the file name, and its state (modified, read-only or non-existent)."
(add-hook 'after-save-hook #'doom-modeline--update-vcs) (add-hook 'after-save-hook #'doom-modeline--update-vcs)
(add-hook 'find-file-hook #'doom-modeline--update-vcs t) (add-hook 'find-file-hook #'doom-modeline--update-vcs t)
(defun doom-modeline-magit-post-refresh ()
"Update vcs state in mode-line after refreshing in magit."
(dolist (buf (buffer-list))
(when (and (not (buffer-modified-p buf))
(buffer-file-name buf)
(file-exists-p (buffer-file-name buf))
(file-in-directory-p (buffer-file-name buf) (magit-toplevel)))
(with-current-buffer buf
(vc-refresh-state)
(doom-modeline--update-vcs)))))
(add-hook 'magit-post-refresh-hook #'doom-modeline-magit-post-refresh)
(doom-modeline-def-segment vcs (doom-modeline-def-segment vcs
"Displays the current branch, colored based on its state." "Displays the current branch, colored based on its state."
(if (doom-modeline--active) (if (doom-modeline--active)