mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-23 11:09:54 +00:00
[Feature] Add indicator for objed state.
This commit is contained in:
parent
2140ded3de
commit
bcb8be67e6
2 changed files with 31 additions and 2 deletions
|
@ -71,6 +71,8 @@
|
|||
(defvar mu4e-alert-mode-line)
|
||||
(defvar mu4e-alert-modeline-formatter)
|
||||
(defvar nyan-minimum-window-width)
|
||||
(defvar objed--object)
|
||||
(defvar objed--obj-state)
|
||||
(defvar persp-nil-name)
|
||||
(defvar symbol-overlay-keywords-alist)
|
||||
(defvar symbol-overlay-temp-symbol)
|
||||
|
@ -1448,6 +1450,33 @@ mouse-1: Display Line and Column Mode Menu"
|
|||
(doom-modeline--ryo)
|
||||
(doom-modeline--xah-fly-keys)))
|
||||
|
||||
|
||||
;;
|
||||
;; objed-state
|
||||
;;
|
||||
|
||||
(defvar doom-modeline--objed-active nil)
|
||||
|
||||
(defun doom-modeline-update-objed (_ &optional reset)
|
||||
"Update `objed' status, inactive when RESET is true."
|
||||
(setq doom-modeline--objed-active (not reset)))
|
||||
|
||||
(setq objed-modeline-setup-func #'doom-modeline-update-objed)
|
||||
|
||||
(doom-modeline-def-segment objed-state ()
|
||||
"The current objed state."
|
||||
(when (and doom-modeline--objed-active
|
||||
(doom-modeline--active))
|
||||
(propertize
|
||||
(format " %s(%s) "
|
||||
(symbol-name objed--object)
|
||||
(char-to-string (aref (symbol-name objed--obj-state) 0)))
|
||||
'face 'doom-modeline-evil-emacs-state
|
||||
'help-echo (format "Objed object: %s (%s)"
|
||||
(symbol-name objed--object)
|
||||
(symbol-name objed--obj-state)))))
|
||||
|
||||
|
||||
;;
|
||||
;; input method
|
||||
;;
|
||||
|
|
|
@ -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)
|
||||
'(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 lsp irc mu4e github debug fancy-battery minor-modes input-method buffer-encoding major-mode process vcs checker))
|
||||
|
||||
(doom-modeline-def-modeline 'minimal
|
||||
'(bar matches " " buffer-info)
|
||||
|
@ -92,7 +92,7 @@
|
|||
|
||||
(doom-modeline-def-modeline 'special
|
||||
'(bar window-number modals matches buffer-info-simple buffer-position parrot selection-info)
|
||||
'(misc-info lsp irc-buffers debug fancy-battery minor-modes input-method buffer-encoding major-mode process checker))
|
||||
'(objed-state misc-info lsp irc-buffers debug fancy-battery minor-modes input-method buffer-encoding major-mode process checker))
|
||||
|
||||
(doom-modeline-def-modeline 'project
|
||||
'(bar window-number " " buffer-default-directory)
|
||||
|
|
Loading…
Reference in a new issue