mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-23 19:19:50 +00:00
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:
parent
32963f4d29
commit
3d8e81b7e1
1 changed files with 0 additions and 12 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue