mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
fix(format): prefix arg inhibiting format-on-save
We bind to basic-save-buffer in :config default (and save-buffer calls it too), so we advise that instead. However, this is a temporary solution because it casts way too wide a net. Probably better to add a new save-without-formatting keybind instead. Fix: #8420
This commit is contained in:
@ -47,8 +47,8 @@ This is controlled by `+format-on-save-disabled-modes'."
|
|||||||
|
|
||||||
(defadvice! +format--inhibit-reformat-on-prefix-arg-a (orig-fn &optional arg)
|
(defadvice! +format--inhibit-reformat-on-prefix-arg-a (orig-fn &optional arg)
|
||||||
"Make it so \\[save-buffer] with prefix arg inhibits reformatting."
|
"Make it so \\[save-buffer] with prefix arg inhibits reformatting."
|
||||||
:around #'save-buffer
|
:around #'basic-save-buffer
|
||||||
(let ((apheleia-mode (and apheleia-mode (memq arg '(nil 1)))))
|
(let ((apheleia-inhibit (or apheleia-inhibit current-prefix-arg)))
|
||||||
(funcall orig-fn)))
|
(funcall orig-fn)))
|
||||||
|
|
||||||
;; HACK: Apheleia suppresses notifications that the current buffer has
|
;; HACK: Apheleia suppresses notifications that the current buffer has
|
||||||
|
Reference in New Issue
Block a user