From 1df1a7e49015004a7fb54f7baa8fb1767b3960ec Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Fri, 27 Oct 2023 14:19:34 +0800 Subject: [PATCH] refactor: update the format of workspace --- doom-modeline-segments.el | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index 50b42a3b..5f0887a4 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -1493,12 +1493,14 @@ regions, 5. The current/total for the highlight term (with `symbol-overlay'), (doom-modeline-def-segment bar "The bar regulates the height of the `doom-modeline' in GUI." - (if doom-modeline-hud - (doom-modeline--hud) - (doom-modeline--bar))) + (concat + (if doom-modeline-hud + (doom-modeline--hud) + (doom-modeline--bar)) + (doom-modeline-spc))) (doom-modeline-def-segment hud - "Powerline's hud segment reimplemented in the style of Doom's bar segment." + "Powerline's hud segment reimplemented in the style of bar segment." (doom-modeline--hud)) @@ -1546,18 +1548,17 @@ one. The ignored buffers are excluded unless `aw-ignore-on' is nil." ((bound-and-true-p window-numbering-mode) (window-numbering-get-number-string)) (t "")))) - (if (and (length> num 0) - (length> (cl-mapcan - (lambda (frame) - ;; Exclude minibuffer and child frames - (unless (and (fboundp 'frame-parent) - (frame-parent frame)) - (window-list frame 'never))) - (visible-frame-list)) - 1)) - (propertize (format " %s " num) - 'face (doom-modeline-face 'doom-modeline-buffer-major-mode)) - (doom-modeline-spc)))) + (when (and (length> num 0) + (length> (cl-mapcan + (lambda (frame) + ;; Exclude minibuffer and child frames + (unless (and (fboundp 'frame-parent) + (frame-parent frame)) + (window-list frame 'never))) + (visible-frame-list)) + 1)) + (propertize (format " %s " num) + 'face (doom-modeline-face 'doom-modeline-buffer-major-mode))))) ;;