mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-27 11:09:52 +00:00
Merge pull request #190 from justfdot/master
Add icon for persp-name segment
This commit is contained in:
commit
24fd535a69
3 changed files with 12 additions and 3 deletions
|
@ -199,6 +199,9 @@ Strongly recommend to use
|
||||||
;; Whether display perspective name or not. Non-nil to display in mode-line.
|
;; Whether display perspective name or not. Non-nil to display in mode-line.
|
||||||
(setq doom-modeline-persp-name t)
|
(setq doom-modeline-persp-name t)
|
||||||
|
|
||||||
|
;; Whether display icon for persp name. Nil to display a # sign. It respects `doom-modeline-icon'
|
||||||
|
(setq doom-modeline-persp-name-icon nil)
|
||||||
|
|
||||||
;; Whether display `lsp' state or not. Non-nil to display in mode-line.
|
;; Whether display `lsp' state or not. Non-nil to display in mode-line.
|
||||||
(setq doom-modeline-lsp t)
|
(setq doom-modeline-lsp t)
|
||||||
|
|
||||||
|
|
|
@ -189,6 +189,9 @@ If the actual char height is larger, it respects the actual char height.")
|
||||||
(defvar doom-modeline-persp-name t
|
(defvar doom-modeline-persp-name t
|
||||||
"Whether display perspective name or not. Non-nil to display in mode-line.")
|
"Whether display perspective name or not. Non-nil to display in mode-line.")
|
||||||
|
|
||||||
|
(defvar doom-modeline-persp-name-icon nil
|
||||||
|
"Whether display icon for persp name. Nil to display a # sign. It respects `doom-modeline-icon'.")
|
||||||
|
|
||||||
(defvar doom-modeline-lsp t
|
(defvar doom-modeline-lsp t
|
||||||
"Whether display `lsp' state or not. Non-nil to display in mode-line.")
|
"Whether display `lsp' state or not. Non-nil to display in mode-line.")
|
||||||
|
|
||||||
|
|
|
@ -1330,12 +1330,15 @@ Requires `eyebrowse-mode' to be enabled."
|
||||||
(fboundp 'safe-persp-name)
|
(fboundp 'safe-persp-name)
|
||||||
(fboundp 'get-current-persp))
|
(fboundp 'get-current-persp))
|
||||||
(let* ((persp (get-current-persp))
|
(let* ((persp (get-current-persp))
|
||||||
(name (safe-persp-name persp)))
|
(name (safe-persp-name persp))
|
||||||
|
(icon (if (and doom-modeline-icon doom-modeline-persp-name-icon)
|
||||||
|
(concat (doom-modeline-icon-material "aspect_ratio" :v-adjust -0.17) (doom-modeline-spc))
|
||||||
|
"#")))
|
||||||
(unless (string-equal persp-nil-name name)
|
(unless (string-equal persp-nil-name name)
|
||||||
(concat
|
(concat
|
||||||
(doom-modeline-spc)
|
(doom-modeline-spc)
|
||||||
(propertize
|
(propertize
|
||||||
(format "#%s" name)
|
(format "%s%s" icon name)
|
||||||
'face (if (and persp
|
'face (if (and persp
|
||||||
(not (persp-contain-buffer-p (current-buffer) persp)))
|
(not (persp-contain-buffer-p (current-buffer) persp)))
|
||||||
'doom-modeline-persp-buffer-not-in-persp
|
'doom-modeline-persp-buffer-not-in-persp
|
||||||
|
|
Loading…
Reference in a new issue