Skip to content

Commit fed5653

Browse files
fix(:editor): persist text scale after for `set-auto-mode'.
When a buffer is in fundamental mode saving the buffer should not rescale the text to default. Fix: #7378
1 parent ba1dca3 commit fed5653

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lisp/doom-editor.el

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,15 @@ or file path may exist now."
136136
(set-auto-mode)
137137
(not (eq major-mode 'fundamental-mode)))))))
138138

139+
(defadvice! doom--preserve-text-scale-for-set-auto-mode-a (fn)
140+
"Preserve the text scale for `set-auto-mode'.
141+
When a file is saved in `fundamental-mode' the text scale should be preserved.
142+
This helps with that."
143+
:around #'set-auto-mode
144+
(let ((scale text-scale-mode-amount))
145+
(funcall fn)
146+
(text-scale-set scale)))
147+
139148
(defadvice! doom--shut-up-autosave-a (fn &rest args)
140149
"If a file has autosaved data, `after-find-file' will pause for 1 second to
141150
tell you about it. Very annoying. This prevents that."

0 commit comments

Comments
 (0)