ui/zen: add +zen-text-scale variable

This commit is contained in:
Henrik Lissner 2020-01-02 21:54:28 -05:00
parent ec7a067109
commit d426349f21
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -3,6 +3,9 @@
(defvar +zen-mixed-pitch-modes '(markdown-mode org-mode)
"What major-modes to enable `mixed-pitch-mode' in with `writeroom-mode'.")
(defvar +zen-text-scale 1
"The text-scaling level for `writeroom-mode'.")
;;
;;; Packages
@ -11,6 +14,12 @@
(setq writeroom-fullscreen-effect nil
writeroom-maximize-window nil)
(add-hook! 'writeroom-mode-hook
(defun +zen-enable-mixed-pitch-mode-h ()
"Enable `mixed-pitch-mode' when in `+zen-mixed-pitch-modes'."
(when (/= +zen-text-scale 0)
(text-scale-set (if writeroom-mode +zen-text-scale 0)))))
;; Adjust margins when text size is changed
(advice-add #'text-scale-adjust :after #'visual-fill-column-adjust))