From 324ab847a207030ad9d7c6a4ed8b3c53bd5442d6 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Tue, 9 Jul 2019 01:53:37 +0800 Subject: [PATCH] Align right segments after scaling font of the mode-line. --- doom-modeline-core.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doom-modeline-core.el b/doom-modeline-core.el index aa71b32..64143f8 100644 --- a/doom-modeline-core.el +++ b/doom-modeline-core.el @@ -391,9 +391,13 @@ If the actual char height is larger, it respects the actual char height.") " " 'face (if (doom-modeline--active) 'mode-line 'mode-line-inactive) 'display `((space :align-to (- (+ right right-fringe right-margin) - ,(string-width - (format-mode-line - (cons "" rhs-forms))))))) + ,(* (if (number-or-marker-p (face-attribute 'mode-line :height)) + (/ (window-font-width nil 'mode-line) + (frame-char-width) 1.0) + 1) + (string-width + (format-mode-line + (cons "" rhs-forms)))))))) rhs-forms)) (concat "Modeline:\n" (format " %s\n %s"