mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
ui/zen: add +zen-text-scale variable
This commit is contained in:
@ -3,6 +3,9 @@
|
|||||||
(defvar +zen-mixed-pitch-modes '(markdown-mode org-mode)
|
(defvar +zen-mixed-pitch-modes '(markdown-mode org-mode)
|
||||||
"What major-modes to enable `mixed-pitch-mode' in with `writeroom-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
|
;;; Packages
|
||||||
@ -11,6 +14,12 @@
|
|||||||
(setq writeroom-fullscreen-effect nil
|
(setq writeroom-fullscreen-effect nil
|
||||||
writeroom-maximize-window 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
|
;; Adjust margins when text size is changed
|
||||||
(advice-add #'text-scale-adjust :after #'visual-fill-column-adjust))
|
(advice-add #'text-scale-adjust :after #'visual-fill-column-adjust))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user