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:
Henrik Lissner 2018-09-10 08:23:52 -04:00
parent c52d2a5a14
commit 08d9c02218
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -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"))))