mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
lang/go: fix formatter
`use-region-p` is not a reliable mechanism for detecting region-type formatting, so +format-type was added to the editor/format module.
This commit is contained in:
@ -15,7 +15,7 @@
|
|||||||
;; Redefines default formatter to *not* use goimports if reformatting a
|
;; Redefines default formatter to *not* use goimports if reformatting a
|
||||||
;; region; as it doesn't play well with partial code.
|
;; region; as it doesn't play well with partial code.
|
||||||
(set-formatter! 'gofmt
|
(set-formatter! 'gofmt
|
||||||
'(("%s" (if (or (use-region-p)
|
'(("%s" (if (or (eq +format-type 'region)
|
||||||
(not (executable-find "goimports")))
|
(not (executable-find "goimports")))
|
||||||
"gofmt"
|
"gofmt"
|
||||||
"goimports"))))
|
"goimports"))))
|
||||||
|
Reference in New Issue
Block a user