mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-24 03:00:10 +00:00
Show buffer name if the buffer name doesn't equal the file name.
NOTE: Format: "buffer-file-name[buffer-name]". Except the same buffer names in different directories.
This commit is contained in:
parent
b6f98e4646
commit
25b04d5c40
1 changed files with 7 additions and 1 deletions
|
@ -643,7 +643,13 @@ directory, the file name, and its state (modified, read-only or non-existent)."
|
||||||
:v-adjust -0.05)
|
:v-adjust -0.05)
|
||||||
" ")))
|
" ")))
|
||||||
(if doom-modeline-buffer-file-name
|
(if doom-modeline-buffer-file-name
|
||||||
|
;; Show buffer name if the buffer name doesn't equal the file name.
|
||||||
|
;; NOTE: Format: "buffer-file-name[buffer-name]".
|
||||||
|
;; Except the same buffer names in different directories.
|
||||||
|
(if (string-equal (file-name-nondirectory doom-modeline-buffer-file-name)
|
||||||
|
(replace-regexp-in-string "<.+>$" "" (or (buffer-name) "")))
|
||||||
doom-modeline-buffer-file-name
|
doom-modeline-buffer-file-name
|
||||||
|
(format "%s[%s]" doom-modeline-buffer-file-name (buffer-name)))
|
||||||
"%b")))
|
"%b")))
|
||||||
|
|
||||||
(doom-modeline-def-segment buffer-info-simple
|
(doom-modeline-def-segment buffer-info-simple
|
||||||
|
|
Loading…
Reference in a new issue