Skip to content

Commit

Permalink
fix(modeline): move text scale info to echo-bar
Browse files Browse the repository at this point in the history
  • Loading branch information
xuchengpeng committed Nov 30, 2024
1 parent 0f7c186 commit 60441fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
11 changes: 10 additions & 1 deletion lisp/init-echo-bar.el
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
:group 'applications)

(defcustom echo-bar-modules
'(echo-bar--selection-info
'(echo-bar--text-scale
echo-bar--selection-info
echo-bar--word-count
echo-bar--symbol-overlay
echo-bar--multiple-cursors
Expand Down Expand Up @@ -43,11 +44,19 @@ If nil, don't update the echo bar automatically."
:group 'echo-bar
:type 'string)

(defvar text-scale-mode-amount)
(defvar text-scale-mode-lighter)

(declare-function mc/num-cursors "ext:multiple-cursors-core")
(declare-function symbol-overlay-assoc "ext:symbol-overlay")
(declare-function symbol-overlay-get-list "ext:symbol-overlay")
(declare-function symbol-overlay-get-symbol "ext:symbol-overlay")

(defun echo-bar--text-scale ()
"Text-Scale info."
(when (and (boundp 'text-scale-mode-lighter) (/= text-scale-mode-amount 0))
text-scale-mode-lighter))

(defun echo-bar--selection-info ()
"Display selection info."
(when mark-active
Expand Down
14 changes: 1 addition & 13 deletions lisp/init-modeline.el
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@
(defvar eglot-menu-string)
(defvar eglot-server-menu)
(defvar flymake--state)
(defvar text-scale-mode-amount)
(defvar text-scale-mode-lighter)

(declare-function aw-update "ext:ace-window")
(declare-function flymake--diag-type "ext:flymake" t t)
Expand Down Expand Up @@ -156,15 +154,6 @@
(t (upcase (symbol-name (plist-get sys :name)))))))
'face (+modeline-face)))

(defun +modeline--text-scale ()
"Text-Scale info in mode-line."
(when (and (boundp 'text-scale-mode-lighter) (/= text-scale-mode-amount 0))
(propertize
(format "(%s)" text-scale-mode-lighter)
'face (+modeline-face)
'mouse-face '+modeline-highlight-face
'help-echo (concat "Text scale " text-scale-mode-lighter))))

(defun +modeline--eglot ()
"Eglot in mode-line."
(when (bound-and-true-p eglot--managed-mode)
Expand Down Expand Up @@ -265,8 +254,7 @@
:group '+modeline)

(defcustom +modeline-right
'(+modeline--text-scale
+modeline--buffer-encoding
'(+modeline--buffer-encoding
+modeline--eglot
+modeline--major-mode
+modeline--vc-info
Expand Down

0 comments on commit 60441fc

Please sign in to comment.