mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
editor/reformat: refactor & fixes
+ Change +format-type to +format-region-p (now a boolean) + Add PRESERVE-INDENT-P boolean argument to +format-buffer + Add +format-preserve-indentation variable (only controls indent preservation during +format/buffer, not +format/region, where it's always enabled). + Fix error arising from +format|buffer hook when no formatter is defined for the current mode #893 + Change +format|buffer to alias for +format/buffer.
This commit is contained in:
@ -15,7 +15,7 @@
|
||||
;; Redefines default formatter to *not* use goimports if reformatting a
|
||||
;; region; as it doesn't play well with partial code.
|
||||
(set-formatter! 'gofmt
|
||||
'(("%s" (if (or (eq +format-type 'region)
|
||||
'(("%s" (if (or +format-region-p
|
||||
(not (executable-find "goimports")))
|
||||
"gofmt"
|
||||
"goimports"))))
|
||||
|
Reference in New Issue
Block a user