Skip to content

Commit

Permalink
feat: Show file modification status outside Emacs.
Browse files Browse the repository at this point in the history
When file is modified outside Emacs, a new icon is used to indicate that the
buffer needs to be reverted.  This feature is from smart-mode-line.
  • Loading branch information
chihyang authored and seagle0128 committed Sep 3, 2024
1 parent aa5a4a6 commit 6714b50
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion doom-modeline-segments.el
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,12 @@ Uses `nerd-icons-mdicon' to fetch the icon."
(when doom-modeline-buffer-state-icon
(ignore-errors
(concat
(cond (buffer-read-only
(cond ((not (or (and (buffer-file-name) (file-remote-p buffer-file-name))
(verify-visited-file-modtime (current-buffer))))
(doom-modeline-buffer-file-state-icon
"nf-md-reload_alert" "" "%1*"
'doom-modeline-warning))
(buffer-read-only
(doom-modeline-buffer-file-state-icon
"nf-md-lock" "🔒" "%1*"
'doom-modeline-warning))
Expand Down

0 comments on commit 6714b50

Please sign in to comment.