Update the icons of all buffers while changing doom-modeline-icon.

Otherwise, the icons in inactive windows may not be displayed correctly.
This commit is contained in:
Vincent Zhang 2019-03-17 17:54:01 +07:00
parent d3bebe6b2e
commit 48bf1f26b7

View file

@ -227,7 +227,9 @@ buffer where knowing the current project directory is important."
(if (and doom-modeline-icon
(not (featurep 'all-the-icons)))
(require 'all-the-icons))
(doom-modeline-update-buffer-file-icon))))
(dolist (buf (buffer-list))
(with-current-buffer buf
(doom-modeline-update-buffer-file-icon))))))
(add-variable-watcher
'all-the-icons-scale-factor
@ -305,7 +307,9 @@ Uses `all-the-icons-material' to fetch the icon."
(lambda (_sym val op _where)
(when (eq op 'set)
(setq doom-modeline-icon val)
(doom-modeline-update-buffer-file-state-icon))))
(dolist (buf (buffer-list))
(with-current-buffer buf
(doom-modeline-update-buffer-file-state-icon))))))
(add-variable-watcher
'all-the-icons-scale-factor
@ -566,7 +570,9 @@ Uses `all-the-icons-octicon' to fetch the icon."
(lambda (_sym val op _where)
(when (eq op 'set)
(setq doom-modeline-icon val)
(doom-modeline-update-vcs-icon))))
(dolist (buf (buffer-list))
(with-current-buffer buf
(doom-modeline-update-vcs-icon))))))
(add-variable-watcher
'all-the-icons-scale-factor
@ -695,8 +701,10 @@ mouse-2: Show help for minor mode")
(lambda (_sym val op _where)
(when (eq op 'set)
(setq doom-modeline-icon val)
(dolist (buf (buffer-list))
(with-current-buffer buf
(when (bound-and-true-p flycheck-mode)
(flycheck-buffer)))))
(flycheck-buffer)))))))
(add-variable-watcher
'all-the-icons-scale-factor
@ -838,8 +846,10 @@ mouse-2: Show help for minor mode"
(lambda (_sym val op _where)
(when (eq op 'set)
(setq doom-modeline-icon val)
(dolist (buf (buffer-list))
(with-current-buffer buf
(when (bound-and-true-p flymake-mode)
(flymake-start)))))
(flymake-start)))))))
(add-variable-watcher
'all-the-icons-scale-factor