Try to use whitespace.

This commit is contained in:
Vincent Zhang 2019-05-17 01:56:09 +08:00
parent d09943534c
commit 30383defe0

View file

@ -622,7 +622,7 @@ Uses `all-the-icons-octicon' to fetch the icon."
(when-let ((icon (or doom-modeline--vcs-icon (doom-modeline-update-vcs-icon))) (when-let ((icon (or doom-modeline--vcs-icon (doom-modeline-update-vcs-icon)))
(text (or doom-modeline--vcs-text (doom-modeline-update-vcs-text)))) (text (or doom-modeline--vcs-text (doom-modeline-update-vcs-text))))
(concat (concat
(doom-modeline-whitespace) (doom-modeline-whitespace) (doom-modeline-whitespace)
(propertize icon 'face (propertize icon 'face
(if active `(:inherit (if active `(:inherit
mode-line mode-line
@ -962,6 +962,7 @@ icons."
(text (cdr seg))) (text (cdr seg)))
(concat (concat
(doom-modeline-whitespace) (doom-modeline-whitespace)
(if vc-mode (doom-modeline-whitespace))
(when icon (when icon
(propertize icon 'face (propertize icon 'face
(if active `(:inherit (if active `(:inherit
@ -1003,7 +1004,7 @@ lines are selected, or the NxM dimensions of a block selection."
(cons (region-beginning) (region-end))) (cons (region-beginning) (region-end)))
(propertize (propertize
(let ((lines (count-lines beg (min end (point-max))))) (let ((lines (count-lines beg (min end (point-max)))))
(concat " " (concat (doom-modeline-whitespace)
(cond ((or (bound-and-true-p rectangle-mark-mode) (cond ((or (bound-and-true-p rectangle-mark-mode)
(and (bound-and-true-p evil-visual-selection) (and (bound-and-true-p evil-visual-selection)
(eq 'block evil-visual-selection))) (eq 'block evil-visual-selection)))
@ -1018,7 +1019,7 @@ lines are selected, or the NxM dimensions of a block selection."
((format "%dC" (- end beg)))) ((format "%dC" (- end beg))))
(when doom-modeline-enable-word-count (when doom-modeline-enable-word-count
(format " %dW" (count-words beg end))) (format " %dW" (count-words beg end)))
" ")) (doom-modeline-whitespace)))
'face 'doom-modeline-highlight)))) 'face 'doom-modeline-highlight))))
@ -1436,20 +1437,23 @@ See `mode-line-percent-position'.")
(if (and (bound-and-true-p nyan-mode) (if (and (bound-and-true-p nyan-mode)
active active
(>= (window-width) nyan-minimum-window-width)) (>= (window-width) nyan-minimum-window-width))
(concat " " (nyan-create) " " (concat (doom-modeline-whitespace)
(doom-modeline-whitespace)
(nyan-create)
(doom-modeline-whitespace)
(propertize (format-mode-line lc) (propertize (format-mode-line lc)
'help-echo "Buffer position\n\ 'help-echo "Buffer position\n\
mouse-1: Display Line and Column Mode Menu" mouse-1: Display Line and Column Mode Menu"
'mouse-face '(:box 0) 'mouse-face '(:box 0)
'local-map mode-line-column-line-number-mode-map)) 'local-map mode-line-column-line-number-mode-map))
(propertize (propertize
(concat " " (concat (doom-modeline-whitespace)
(format-mode-line lc) (format-mode-line lc)
(if doom-modeline-percent-position (if doom-modeline-percent-position
(format-mode-line '(" " doom-modeline-percent-position "%%"))) (format-mode-line '(" " doom-modeline-percent-position "%%")))
(if (or line-number-mode (if (or line-number-mode
column-number-mode doom-modeline-percent-position) column-number-mode doom-modeline-percent-position)
" ")) (doom-modeline-whitespace)))
'face (if active 'mode-line 'mode-line-inactive) 'face (if active 'mode-line 'mode-line-inactive)
'help-echo "Buffer position\n\ 'help-echo "Buffer position\n\
mouse-1: Display Line and Column Mode Menu" mouse-1: Display Line and Column Mode Menu"
@ -1463,7 +1467,10 @@ mouse-1: Display Line and Column Mode Menu"
"The party parrot animated icon. Requires `parrot-mode' to be enabled." "The party parrot animated icon. Requires `parrot-mode' to be enabled."
(when (and (bound-and-true-p parrot-mode) (when (and (bound-and-true-p parrot-mode)
(doom-modeline--active)) (doom-modeline--active))
(concat " " (parrot-create) " "))) (concat (doom-modeline-whitespace)
(doom-modeline-whitespace)
(parrot-create)
(doom-modeline-whitespace))))
;; ;;
;; modals (evil, god, ryo and xah-fly-keys, etc.) ;; modals (evil, god, ryo and xah-fly-keys, etc.)
@ -1551,13 +1558,15 @@ mouse-1: Display Line and Column Mode Menu"
(propertize (propertize
(cond (cond
(current-input-method (current-input-method
(concat " " current-input-method-title " ")) (concat (doom-modeline-whitespace)
current-input-method-title
(doom-modeline-whitespace)))
((and (bound-and-true-p evil-local-mode) ((and (bound-and-true-p evil-local-mode)
(bound-and-true-p evil-input-method)) (bound-and-true-p evil-input-method))
(concat (concat
" " (doom-modeline-whitespace)
(nth 3 (assoc default-input-method input-method-alist)) (nth 3 (assoc default-input-method input-method-alist))
" ")) (doom-modeline-whitespace)))
(t "")) (t ""))
'face (if (doom-modeline--active) 'face (if (doom-modeline--active)
'doom-modeline-buffer-major-mode 'doom-modeline-buffer-major-mode