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:
Henrik Lissner
2025-06-19 19:41:37 +02:00
parent cdc9566d0b
commit f0c8290ae2

View File

@ -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)
"Make it so \\[save-buffer] with prefix arg inhibits reformatting."
:around #'save-buffer
(let ((apheleia-mode (and apheleia-mode (memq arg '(nil 1)))))
:around #'basic-save-buffer
(let ((apheleia-inhibit (or apheleia-inhibit current-prefix-arg)))
(funcall orig-fn)))
;; HACK: Apheleia suppresses notifications that the current buffer has