From 52243514afecb49891b41e897c6f78e8cda68ca2 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Fri, 28 Sep 2018 16:27:52 +0800 Subject: [PATCH] Fix #31: support input-method. --- doom-modeline.el | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/doom-modeline.el b/doom-modeline.el index fa746fe..3e413ed 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -1043,13 +1043,28 @@ See `mode-line-percent-position'.") ((eq tag evil-replace-state-tag) 'doom-modeline-evil-replace-state))))))) +;; +;; input method +;; + +(doom-modeline-def-segment input-method + "The current input method." + (cond + (current-input-method + (concat current-input-method-title " ")) + ((and (bound-and-true-p evil-mode) + (bound-and-true-p evil-input-method)) + (concat + (nth 3 (assoc default-input-method input-method-alist)) + " ")))) + ;; ;; Mode lines ;; (doom-modeline-def-modeline 'main '(workspace-number window-number bar evil-state matches " " buffer-info buffer-position " " selection-info) - '(global buffer-encoding major-mode process vcs flycheck)) + '(global input-method buffer-encoding major-mode process vcs flycheck)) (doom-modeline-def-modeline 'minimal '(bar matches " " buffer-info) @@ -1057,7 +1072,7 @@ See `mode-line-percent-position'.") (doom-modeline-def-modeline 'special '(window-number bar evil-state matches " " buffer-info-simple buffer-position " " selection-info) - '(global buffer-encoding major-mode process flycheck)) + '(global input-method buffer-encoding major-mode process flycheck)) (doom-modeline-def-modeline 'project '(window-number bar buffer-default-directory)