From 79dc0ca1a94aa508fcc7d09a2349c976dda81324 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Sat, 6 Nov 2021 18:49:14 +0800 Subject: [PATCH] Keep both position indicator and percent position. Close #488. --- doom-modeline-segments.el | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index b65f61f..b6e142e 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -1668,6 +1668,7 @@ See `mode-line-percent-position'.") (doom-modeline-spc) (doom-modeline-spc) + ;; Line and column (propertize (format-mode-line lc) 'face face 'help-echo "Buffer position\n\ @@ -1675,6 +1676,7 @@ mouse-1: Display Line and Column Mode Menu" 'mouse-face mouse-face 'local-map local-map) + ;; Position (cond ((and active (bound-and-true-p nyan-mode) (not doom-modeline--limited-width-p) @@ -1708,16 +1710,19 @@ mouse-1: Display Line and Column Mode Menu" (doom-modeline-spc) (doom-modeline-spc) (propertize (sml-modeline-create) 'mouse-face mouse-face))) - (t - (when doom-modeline-percent-position - (concat - (doom-modeline-spc) - (propertize (format-mode-line '("" doom-modeline-percent-position "%%")) - 'face face - 'help-echo "Buffer percentage\n\ + (t "")) + + ;; Percent position + (when doom-modeline-percent-position + (concat + (doom-modeline-spc) + (propertize (format-mode-line '("" doom-modeline-percent-position "%%")) + 'face face + 'help-echo "Buffer percentage\n\ mouse-1: Display Line and Column Mode Menu" - 'mouse-face mouse-face - 'local-map local-map))))) + 'mouse-face mouse-face + 'local-map local-map))) + (when (or line-number-mode column-number-mode doom-modeline-percent-position) (doom-modeline-spc)))))