mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
editor/format: defer test for formatter
By deferring formatter predicates until formatting actually happens, users won't have to reset the major mode to get formatting to work.
This commit is contained in:
@ -29,8 +29,7 @@ This is controlled by `+format-on-save-enabled-modes'."
|
||||
((eq (car +format-on-save-enabled-modes) 'not)
|
||||
(memq major-mode (cdr +format-on-save-enabled-modes)))
|
||||
((not (memq major-mode +format-on-save-enabled-modes))))
|
||||
(not (require 'format-all nil t))
|
||||
(equal (format-all-probe) (list nil nil)))
|
||||
(not (require 'format-all nil t)))
|
||||
(add-hook 'before-save-hook #'+format|buffer nil t)))
|
||||
|
||||
(when (featurep! +onsave)
|
||||
|
Reference in New Issue
Block a user