From fd66e7d2b7d7aaef7b36663877a44fd6d8db0e8c Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Thu, 5 Dec 2019 01:31:17 +0800 Subject: [PATCH] Better Workaround: Fix tall issue of 27 on Linux. See #271. --- doom-modeline-core.el | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/doom-modeline-core.el b/doom-modeline-core.el index 9a1edea..8eee37b 100644 --- a/doom-modeline-core.el +++ b/doom-modeline-core.el @@ -770,9 +770,16 @@ If DEFAULT is non-nil, set the default mode-line for all buffers." (defun doom-modeline--font-height () "Calculate the actual char height of the mode-line." (let ((height (face-attribute 'mode-line :height))) - (cond ((integerp height) (/ height 10)) - ((floatp height) (* height (frame-char-height))) - (t (frame-char-height))))) + ;; WORKAROUND: Fix tall issue of 27 on Linux + ;; @see https://github.com/seagle0128/doom-modeline/issues/271 + (round + (* (if (and (>= emacs-major-version 27) + (eq system-type 'gnu/linux)) + 1.0 + 1.68) + (cond ((integerp height) (/ height 10)) + ((floatp height) (* height (frame-char-height))) + (t (frame-char-height))))))) (defun doom-modeline-add-variable-watcher (symbol watch-function) "Cause WATCH-FUNCTION to be called when SYMBOL is set if possible. @@ -787,7 +794,9 @@ See docs of `add-variable-watcher'." ICON-SET includes `octicon', `faicon', `material', `alltheicons' and `fileicon'. UNICODE is the unicode char fallback. TEXT is the ASCII char fallback." (let ((face (or face 'mode-line))) - (or (when (and doom-modeline-icon icon-name (not (string-empty-p icon-name))) + (or (when (and doom-modeline-icon + icon-name + (not (string-empty-p icon-name))) (pcase icon-set ('octicon (apply #'all-the-icons-octicon icon-name :face face args))