From c60dd1279afa8a03a31ec071c907d9399adedfae Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Mon, 29 Oct 2018 22:47:34 +0800 Subject: [PATCH] Refactor evil-state. --- doom-modeline.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doom-modeline.el b/doom-modeline.el index 119d38e..eb3509d 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -1088,15 +1088,15 @@ See `mode-line-percent-position'.") "The current evil state. Requires `evil-mode' to be enabled." (when (bound-and-true-p evil-local-mode) (let ((tag (evil-state-property evil-state :tag t))) - (propertize (s-trim-right tag) 'face + (propertize tag 'face (if (doom-modeline--active) - (cond ((eq tag evil-normal-state-tag) 'doom-modeline-evil-normal-state) - ((eq tag evil-emacs-state-tag) 'doom-modeline-evil-emacs-state) - ((eq tag evil-insert-state-tag) 'doom-modeline-evil-insert-state) - ((eq tag evil-motion-state-tag) 'doom-modeline-evil-motion-state) - ((eq tag evil-visual-state-tag) 'doom-modeline-evil-visual-state) - ((eq tag evil-operator-state-tag) 'doom-modeline-evil-operator-state) - ((eq tag evil-replace-state-tag) 'doom-modeline-evil-replace-state))))))) + (cond ((evil-normal-state-p) 'doom-modeline-evil-normal-state) + ((evil-emacs-state-p) 'doom-modeline-evil-emacs-state) + ((evil-insert-state-p) 'doom-modeline-evil-insert-state) + ((evil-motion-state-p) 'doom-modeline-evil-motion-state) + ((evil-visual-state-p) 'doom-modeline-evil-visual-state) + ((evil-operator-state-p) 'doom-modeline-evil-operator-state) + ((evil-replace-state-p) 'doom-modeline-evil-replace-state))))))) ;;