From 292f7bd238c68d5d76a52c2dd384ab9ec4c222b6 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Tue, 12 Mar 2019 00:59:28 +0700 Subject: [PATCH] Optimize performance of lsp indicator. --- doom-modeline-segments.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index d79a80a..15e611a 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -86,6 +86,7 @@ (declare-function aw-update 'ace-window) (declare-function aw-window-list 'ace-window) (declare-function battery-format 'battery) +(declare-function eglot--current-server 'eglot) (declare-function eglot--major-mode 'eglot) (declare-function eglot--project-nickname 'eglot) (declare-function eglot--spinner 'eglot) @@ -1508,7 +1509,7 @@ mouse-3: Reconnect to server") #'lsp-restart-workspace)) map))) " ")) - ((and (fboundp 'eglot--current-server) (eglot--current-server)) + ((bound-and-true-p eglot--managed-mode) (pcase-let* ((icon (if doom-modeline-icon (doom-modeline-icon-faicon "rocket" :v-adjust -0.0575) "EGLOT"))