summaryrefslogtreecommitdiff
path: root/modeline.el
diff options
context:
space:
mode:
Diffstat (limited to 'modeline.el')
-rw-r--r--modeline.el30
1 files changed, 30 insertions, 0 deletions
diff --git a/modeline.el b/modeline.el
index 7da967e..0fdd0d5 100644
--- a/modeline.el
+++ b/modeline.el
@@ -43,6 +43,7 @@
(defun modeline-format-right ()
"The right mode line format."
(concat
+ (modeline-format-input-method)
(modeline-format-major-mode)
(modeline-format-vc-mode)))
@@ -137,6 +138,14 @@ MAP is the local keymap of the text."
(defface doom-modeline-buffer-major-mode nil
"The face for mode line major mode.")
+;;;###autoload
+(defface doom-modeline-input-method nil
+ "The face for mode line input method.")
+
+;;;###autoload
+(defface doom-modeline-input-method-alt nil
+ "The alternative face for mode line input method.")
+
;;; Various sections of the mode line
;;;###autoload
@@ -482,3 +491,24 @@ This will be displayed in the mode line."
(get-text-property 1 'help-echo vc-mode)
(get-text-property 1 'local-map vc-mode))
(modeline-spc)))))
+
+;;;###autoload
+(defun modeline-format-input-method ()
+ "Display the current input method on the mode line."
+ (cond
+ (current-input-method
+ (concat
+ (modeline-spc)
+ (modeline-propertize
+ (propertize
+ current-input-method-title
+ 'face (cond ((modeline-active-window-p) 'doom-modeline-input-method)
+ (t 'mode-line-inactive)))
+ nil
+ (format "Current input method: %s\nmouse-2: Disable input method\nmouse-3: Describe current input method"
+ current-input-method)
+ mode-line-input-method-map)
+ (modeline-spc))
+ )
+ (t "")))
+