Skip to content

Commit

Permalink
fix(modeline): add eglot segments
Browse files Browse the repository at this point in the history
  • Loading branch information
xuchengpeng committed Aug 25, 2024
1 parent 5ef4e6e commit 3eb86ba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lisp/init-modeline.el
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"Face for errors in the mode-line."
:group 'dotemacs-modeline-faces)

(defvar eglot--mode-line-format)
(defvar flymake--state)
(defvar text-scale-mode-amount)
(defvar text-scale-mode-lighter)
Expand Down Expand Up @@ -295,6 +296,11 @@ Return `default-directory' if no project was found."
'help-echo (concat "Text scale " text-scale-mode-lighter))
" ")))

(defun dotemacs-modeline--eglot ()
"Eglot in mode-line."
(when (bound-and-true-p eglot--managed-mode)
(concat " " (format-mode-line eglot--mode-line-format) " ")))

(defun dotemacs-modeline--major-mode ()
"Major mode in mode-line."
(concat
Expand Down Expand Up @@ -394,6 +400,7 @@ mouse-3: Previous error"
(defcustom dotemacs-modeline-right
'(dotemacs-modeline--text-scale
dotemacs-modeline--buffer-encoding
dotemacs-modeline--eglot
dotemacs-modeline--major-mode
dotemacs-modeline--vc-info
dotemacs-modeline--flymake)
Expand Down

0 comments on commit 3eb86ba

Please sign in to comment.