Skip to content

Commit

Permalink
fix: buffer name issue introduced in #756
Browse files Browse the repository at this point in the history
  • Loading branch information
seagle0128 committed Dec 25, 2024
1 parent c5a8379 commit 9864471
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions doom-modeline-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,7 @@ Return `default-directory' if no project was found."
If TRUNCATE-TAIL is t also truncate the parent directory of the file."
(let ((dirs (shrink-path-prompt (file-name-directory true-file-path))))
(if (null dirs)
(propertize "%b" 'face 'doom-modeline-buffer-file)
(propertize (buffer-name) 'face 'doom-modeline-buffer-file)
(let ((dirname (car dirs))
(basename (cdr dirs)))
(concat (propertize (concat dirname
Expand All @@ -1677,7 +1677,7 @@ If TRUNCATE-TAIL is t also truncate the parent directory of the file."
If INCLUDE-PROJECT is non-nil, the project path will be included."
(let ((root (file-local-name (doom-modeline-project-root))))
(if (null root)
(propertize "%b" 'face 'doom-modeline-buffer-file)
(propertize (buffer-name) 'face 'doom-modeline-buffer-file)
(let ((relative-dirs (file-relative-name (file-name-directory true-file-path)
(if include-project (concat root "../") root))))
(and (equal "./" relative-dirs) (setq relative-dirs ""))
Expand Down
4 changes: 2 additions & 2 deletions doom-modeline-segments.el
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ Uses `nerd-icons-mdicon' to fetch the icon."
(save-match-data
(if buffer-file-name
(doom-modeline-buffer-file-name)
(propertize "%b"
(propertize (buffer-name)
'face 'doom-modeline-buffer-file
'mouse-face 'doom-modeline-highlight
'help-echo "Buffer name
Expand Down Expand Up @@ -400,7 +400,7 @@ mouse-1: Previous buffer\nmouse-3: Next buffer"

(defsubst doom-modeline--buffer-simple-name ()
"The buffer simple name."
(propertize "%b"
(propertize (buffer-name)
'face (doom-modeline-face
(if (and doom-modeline-highlight-modified-buffer-name
(buffer-modified-p))
Expand Down

0 comments on commit 9864471

Please sign in to comment.