From 2bbfcbe6851200880bbbbbcf34278ebfb4a425bc Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Mon, 6 May 2019 22:55:49 +0800 Subject: [PATCH] Show lsp indicator in both active and inactive windows. --- doom-modeline-segments.el | 20 ++++++++++++-------- doom-modeline.el | 6 +++--- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index eda850d..283d86d 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -1524,7 +1524,7 @@ mouse-3: Describe current input method") (defun doom-modeline-lsp-icon (text face) "Display LSP icon (or TEXT in terminal) with FACE." (if doom-modeline-icon - (doom-modeline-icon-faicon "rocket" :face face :v-adjust -0.0575) + (doom-modeline-icon-faicon "rocket" :height 1.0 :face face :v-adjust -0.0575) (propertize text 'face face))) (defvar doom-modeline--lsp nil) @@ -1630,13 +1630,17 @@ mouse-3: Reconnect to server" nick (eglot--major-mode server))) (doom-modeline-def-segment lsp "The LSP server state." - (if (and doom-modeline-lsp - (doom-modeline--active)) - (cond - ((bound-and-true-p lsp-mode) - doom-modeline--lsp) - ((bound-and-true-p eglot--managed-mode) - doom-modeline--eglot)))) + (when doom-modeline-lsp + (when-let ((icon (cond ((bound-and-true-p lsp-mode) + doom-modeline--lsp) + ((bound-and-true-p eglot--managed-mode) + doom-modeline--eglot)))) + (propertize icon 'face `(:inherit + ,(get-text-property 1 'face icon) + :inherit + ,(if (doom-modeline--active) + 'mode-line + 'mode-line-inactive)))))) (defun doom-modeline-override-eglot-modeline () "Override `eglot' mode-line." diff --git a/doom-modeline.el b/doom-modeline.el index 07d7ccc..51877a0 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -84,7 +84,7 @@ (doom-modeline-def-modeline 'main '(bar workspace-name window-number modals matches buffer-info remote-host buffer-position parrot selection-info) - '(objed-state misc-info persp-name lsp irc mu4e github debug fancy-battery minor-modes input-method buffer-encoding major-mode process vcs checker)) + '(objed-state misc-info persp-name fancy-battery irc mu4e github debug lsp minor-modes input-method buffer-encoding major-mode process vcs checker)) (doom-modeline-def-modeline 'minimal '(bar matches " " buffer-info) @@ -92,11 +92,11 @@ (doom-modeline-def-modeline 'special '(bar window-number modals matches buffer-info-simple buffer-position parrot selection-info) - '(objed-state misc-info lsp irc-buffers debug fancy-battery minor-modes input-method buffer-encoding major-mode process checker)) + '(objed-state misc-info fancy-battery irc-buffers debug lsp minor-modes input-method buffer-encoding major-mode process checker)) (doom-modeline-def-modeline 'project '(bar window-number " " buffer-default-directory) - '(misc-info mu4e github debug fancy-battery " " major-mode process)) + '(misc-info fancy-battery mu4e github debug " " major-mode process)) (doom-modeline-def-modeline 'media '(bar window-number buffer-size buffer-info)