-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breaking change https://github.com/fatih/vim-go/pull/1211 #1212
Comments
I don't understand the issue. If your go_fmt_command is set to goimports, then it makes sense that go_fmt_options would be goimports options. In #1211 @hori-ryota wrote that he wants to use And if it's not OK to use go_fmt_options with goimports, why is it OK to use with some other command? For example what if I set go_fmt_command = "mytool", and mytool doesn't have |
I think I understand now -- this is for using the explicit commands :GoFmt and :GoImports rather than the automatic gofmt-on-save. Looking at this more, the situation is kind of messy. To summarize:
It's strange that GoFmt and GoImports might run different commands than "gofmt" and "goimports". (For example, with my vim configuration, where I have I don't think the proposed solution (adding go_imports_options and special-casing the string "goimports" in TBH I'm not sure why :GoImports exists -- everything would be much simpler if there were only :GoFmt and go_fmt_command and then it would be unambiguous that if you set As a compromise, we could change go_fmt_options to be a dictionary: let g:go_fmt_options = {
\ 'gofmt': '-s',
\ 'goimports': '-local mycompany.com',
\ } This doesn't help with the :Gofmt/:GoImports confusion though. |
Is it such an implementation that you mean? let opts = g:go_fmt_options
if type(g:go_fmt_options) == type({})
let opts = has_key(g:go_fmt_options, a:bin_name) ? g:go_fmt_options[a:bin_name] : ""
endif
call extend(cmd, split(opts, " ")) |
Just to chime in @cespare. The reason I agree that it's a little bis mess. I'll look later more in detail |
Is it wrong to revert once? |
* add the ability to specificy binary specific options * remove `go_imports_bin` settings as it's subject to confusing Thanks to @cespare for the idea and @hori-ryota for initial code snippet Fixes #1212
* add the ability to specificy binary specific options * remove `go_imports_bin` settings as it's subject to confusing Thanks to @cespare for the idea and @hori-ryota for initial code snippet Fixes #1212
Should be reverted or fixed
The text was updated successfully, but these errors were encountered: