diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index 68f3f4b..8251bcf 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -237,6 +237,8 @@ Uses `all-the-icons-material' to fetch the icon." (add-hook 'read-only-mode-hook #'doom-modeline-update-buffer-file-state-icon) (add-hook 'after-change-functions #'doom-modeline-update-buffer-file-state-icon) (add-hook 'clone-indirect-buffer-hook #'doom-modeline-update-buffer-file-state-icon) +(advice-add #'set-buffer-modified-p :after #'doom-modeline-update-buffer-file-state-icon) +(advice-add #'restore-buffer-modified-p :after #'doom-modeline-update-buffer-file-state-icon) (advice-add #'undo :after #'doom-modeline-update-buffer-file-state-icon) (advice-add #'undo-tree-undo-1 :after #'doom-modeline-update-buffer-file-state-icon) (advice-add #'undo-tree-redo-1 :after #'doom-modeline-update-buffer-file-state-icon) @@ -287,6 +289,8 @@ mouse-1: Previous buffer\nmouse-3: Next buffer" (add-hook 'evil-insert-state-exit-hook #'doom-modeline-update-buffer-file-state-icon) (advice-add #'rename-buffer :after #'doom-modeline-update-buffer-file-name) (advice-add #'set-visited-file-name :after #'doom-modeline-update-buffer-file-name) +(advice-add #'set-buffer-modified-p :after #'doom-modeline-update-buffer-file-name) +(advice-add #'restore-buffer-modified-p :after #'doom-modeline-update-buffer-file-name) (advice-add #'undo :after #'doom-modeline-update-buffer-file-name) (advice-add #'undo-tree-undo-1 :after #'doom-modeline-update-buffer-file-name) (advice-add #'undo-tree-redo-1 :after #'doom-modeline-update-buffer-file-name)