fix(:editor): persist text scale after mode guess

When a buffer is in fundamental mode saving the buffer should not
rescale the text to default.

Fix: #7378
This commit is contained in:
Nick Torosian 2024-11-30 15:00:48 +02:00
parent ba1dca322f
commit d3920cf0b6
No known key found for this signature in database

View file

@ -136,6 +136,15 @@ or file path may exist now."
(set-auto-mode)
(not (eq major-mode 'fundamental-mode)))))))
(defadvice! doom--preserve-text-scale-for-guess-mode-a (fn)
"Preserve the text scale for `set-auto-mode'.
When a file is saved in `fundamental-mode' the text scale should be preserved.
This helps with that."
:around #'set-auto-mode
(let ((scale text-scale-mode-amount))
(funcall fn)
(text-scale-set scale)))
(defadvice! doom--shut-up-autosave-a (fn &rest args)
"If a file has autosaved data, `after-find-file' will pause for 1 second to
tell you about it. Very annoying. This prevents that."