From dfab28d79fc690ed4f5913909fe65446d1dc2788 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 30 Apr 2021 12:49:58 -0500 Subject: Add the text scale to the modeline --- init.el | 1 + lisp/acdw-modeline.el | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/init.el b/init.el index 0a82bfd..307b753 100644 --- a/init.el +++ b/init.el @@ -939,6 +939,7 @@ if ripgrep is installed, otherwise `consult-grep'." simple-modeline-segment-position simple-modeline-segment-word-count) (simple-modeline-segment-misc-info + acdw-modeline/text-scale simple-modeline-segment-process acdw-modeline/god-mode-indicator acdw-modeline/minions diff --git a/lisp/acdw-modeline.el b/lisp/acdw-modeline.el index 79249bb..7eca143 100644 --- a/lisp/acdw-modeline.el +++ b/lisp/acdw-modeline.el @@ -73,6 +73,16 @@ indicator in the mode-line." (minions-minor-modes-menu))))) 'mouse-face 'mode-line-highlight))) +(defun acdw-modeline/text-scale () + ;; adapted from https://github.com/seagle0128/doom-modeline + (when (and (boundp 'text-scale-mode-amount) + (/= text-scale-mode-amount 0)) + (format + (if (> text-scale-mode-amount 0) + " (%+d)" + " (%-d)") + text-scale-mode-amount))) + (defun acdw-modeline/vc-branch () ;; from https://www.gonsie.com/blorg/modeline.html, from Doom (if-let ((backend (vc-backend buffer-file-name))) -- cgit 1.4.1-21-gabe81