Skip to content

Commit

Permalink
[Refactor] Add doom-modeline-wspc.
Browse files Browse the repository at this point in the history
  • Loading branch information
seagle0128 committed Nov 6, 2021
1 parent 79dc0ca commit b59802e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
6 changes: 6 additions & 0 deletions doom-modeline-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,12 @@ If DEFAULT is non-nil, set the default mode-line for all buffers."
'doom-modeline-spc-face
'(:inherit mode-line-inactive))))

(defsubst doom-modeline-wspc ()
"Text style with wide whitespace."
(propertize " " 'face (if (doom-modeline--active)
'doom-modeline-spc-face
'(:inherit mode-line-inactive))))

(defsubst doom-modeline-vspc ()
"Text style with icons in mode-line."
(propertize " " 'face (if (doom-modeline--active)
Expand Down
18 changes: 6 additions & 12 deletions doom-modeline-segments.el
Original file line number Diff line number Diff line change
Expand Up @@ -1665,8 +1665,7 @@ See `mode-line-percent-position'.")
(mouse-face 'mode-line-highlight)
(local-map mode-line-column-line-number-mode-map))
(concat
(doom-modeline-spc)
(doom-modeline-spc)
(doom-modeline-wspc)

;; Line and column
(propertize (format-mode-line lc)
Expand All @@ -1682,33 +1681,29 @@ mouse-1: Display Line and Column Mode Menu"
(not doom-modeline--limited-width-p)
(>= (window-width) nyan-minimum-window-width))
(concat
(doom-modeline-spc)
(doom-modeline-spc)
(doom-modeline-wspc)
(propertize (nyan-create) 'mouse-face mouse-face)))
((and active
(bound-and-true-p poke-line-mode)
(not doom-modeline--limited-width-p)
(>= (window-width) poke-line-minimum-window-width))
(concat
(doom-modeline-spc)
(doom-modeline-spc)
(doom-modeline-wspc)
(propertize (poke-line-create) 'mouse-face mouse-face)))
((and active
(bound-and-true-p mlscroll-mode)
(not doom-modeline--limited-width-p)
(>= (window-width) mlscroll-minimum-current-width))
(concat
(doom-modeline-spc)
(doom-modeline-spc)
(doom-modeline-wspc)
(let ((mlscroll-right-align nil))
(format-mode-line (mlscroll-mode-line)))))
((and active
(bound-and-true-p sml-modeline-mode)
(not doom-modeline--limited-width-p)
(>= (window-width) sml-modeline-len))
(concat
(doom-modeline-spc)
(doom-modeline-spc)
(doom-modeline-wspc)
(propertize (sml-modeline-create) 'mouse-face mouse-face)))
(t ""))

Expand All @@ -1734,8 +1729,7 @@ mouse-1: Display Line and Column Mode Menu"
(when (and (doom-modeline--active)
(not doom-modeline--limited-width-p)
(bound-and-true-p parrot-mode))
(concat (doom-modeline-spc)
(doom-modeline-spc)
(concat (doom-modeline-wspc)
(parrot-create)
(doom-modeline-spc))))

Expand Down

0 comments on commit b59802e

Please sign in to comment.