Skip to content

Commit

Permalink
fix: Simplify text scale logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Apr 6, 2024
1 parent a699658 commit 615ca1d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions jcs-modeline.el
Original file line number Diff line number Diff line change
Expand Up @@ -457,17 +457,15 @@ mouse-1: Reveal project in folder" project)
;;; Text Scale

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

(defun jcs-modeline--render-text-scale ()
"Render text-scale amount."
(when-let (((and (boundp 'text-scale-mode-amount) (/= text-scale-mode-amount 0)))
(ind (format (if (> text-scale-mode-amount 0)
"%+d"
"%-d")
text-scale-mode-amount)))
(format "(%s) " (propertize ind
(when (and (boundp 'text-scale-mode-lighter)
(/= text-scale-mode-amount 0))
(format "(%s) " (propertize text-scale-mode-lighter
'mouse-face 'mode-line-highlight
'help-echo (concat "Text scale " ind)))))
'help-echo (concat "Text scale " text-scale-mode-lighter)))))

;;
;;; Undo
Expand Down

0 comments on commit 615ca1d

Please sign in to comment.