Skip to content
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

add commands to toggle settings that control auto behavior #945

Merged
merged 4 commits into from
Jul 31, 2016

Conversation

bhcleek
Copy link
Collaborator

@bhcleek bhcleek commented Jul 17, 2016

Add commands to toggle settings that control automatic behaviors. All the new commands begin with GoToggle, and are suffixed with the name of the setting, but using PascalCase in place of snake_case.

Also moved one function so that all functions called by events and functions that control settings are in the same relative order as the respective events.

@bhcleek
Copy link
Collaborator Author

bhcleek commented Jul 22, 2016

@fatih I think these new functions (e.g. s:toggle_auto_type_info()) should be moved to autoload/go/util.vim. At the time I submitted this, I didn't really know how autoloading worked. What do think?

@fatih
Copy link
Owner

fatih commented Jul 28, 2016

Thanks @bhcleek for the work. I've wrote my comments below. Yes they should be moved to autoload/go but under different files to make it maintainable.

  • Can you change the names and append the Toggle to the end? All our commands are like that so you can easily find them.
  • Can you add enabled and disabled echo messages. Check out guru.vim how I've added for sameids. I think each function should have a custom logic. So they should be in the associate files

go_auto_sameids -> guru.vim (this exists already under go#guru#AutoSameIds, so don't touch it)

These should be moved:

go_fmt_autosave -> fmt.vim
go_asmfmt_autosave -> asmfmt.vim
go_metalinter_autosave -> lint.vim
go_template_autocreate -> template.vim

  • Can you please move the commands to ftplugin/go/commands.vim

Move toggle functions into the autoload files that deal with the
particular auto setting's concerns.

Display message when toggling settings.

Remove the command and function to toggle g:go_auto_sameids, because
it's been implemented on master alraedy.

Move the Move commands for toggle auto settings in into
ftplugin/go/commands.vim.
@bhcleek
Copy link
Collaborator Author

bhcleek commented Jul 28, 2016

PTAL

@fatih fatih merged commit 7af695b into fatih:master Jul 31, 2016
@fatih
Copy link
Owner

fatih commented Jul 31, 2016

Thanks @bhcleek 👍

@bhcleek bhcleek deleted the toggle-autos branch July 31, 2016 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants