editor/format: override format-all-buffer w/ +format/buffer
This commit is contained in:
parent
8480f52081
commit
3c34ff003b
|
@ -43,3 +43,11 @@ This is controlled by `+format-on-save-enabled-modes'."
|
|||
;; Allow a specific formatter to be used by setting `+format-with', either
|
||||
;; buffer-locally or let-bound.
|
||||
(advice-add #'format-all-probe :around #'+format*probe)
|
||||
|
||||
;; Doom uses a modded `format-all-buffer', which
|
||||
;; 1. Doesn't move the cursorafter reformatting,
|
||||
;; 2. Can reformat regions, rather than the entire buffer (while preserving
|
||||
;; leading indentation),
|
||||
;; 3. Applies changes via RCS patch, line by line, as not to protect buffer
|
||||
;; markers and avoid any jarring cursor+window scrolling.
|
||||
(advice-add #'format-all-buffer :override #'+format/buffer)
|
||||
|
|
Loading…
Reference in New Issue
Block a user