diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index fd6df80..192a466 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -213,6 +213,17 @@ buffer where knowing the current project directory is important." (add-hook 'clone-indirect-buffer-hook #'doom-modeline-update-buffer-file-icon) (when (>= emacs-major-version 26) + (add-variable-watcher + 'doom-modeline-icon + (lambda (_sym val op _where) + (when (eq op 'set) + (setq doom-modeline-icon val) + ;; Fix #149: hang while changing `doom-modeline-icon' from nil to t + (if (and doom-modeline-icon + (not (featurep 'all-the-icons))) + (require 'all-the-icons)) + (doom-modeline-update-buffer-file-icon)))) + (add-variable-watcher 'all-the-icons-scale-factor (lambda (_sym val op _where)