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

refactor autocmd configuration #2108

Merged
merged 2 commits into from
Jan 9, 2019
Merged

refactor autocmd configuration #2108

merged 2 commits into from
Jan 9, 2019

Conversation

bhcleek
Copy link
Collaborator

@bhcleek bhcleek commented Dec 29, 2018

remove commented out experimental SameID code

Remove the commented out experimental code for highlighting the uses of
a particular identifier. The feature was implemented a couple of years
ago, and then commented out experimental code no longer serves any
purpose.

refactor autocmd events

Refactor ftdetect/gofiletype.vim so that it only sets filetype; it no
longer sets fileformat or fileencoding. fileformat and fileencoding are
now set by autocmd events configured in plugin/go.vim

Move most functions called by autocmd events into autoload/go/auto.vim.
The only exceptions are s:gofiletype_pre and s:gofiletype_post in
plugin/go.vim.

Consistently use setfiletype; previously set filetype was used for
gohtmltmpl and gomod files.

Change s:gofiletype_pre in plugin/go.vim so that it does not set the
filetype; it's already set in ftdetect/go.vim and setting it again may
cause problems for any user that needs to set it to something else.

Move the configuration of all autocmd events that occur after the
FileType event into ftplugin files and clear them in undo_ftplugin so
that they will not execute if the filetype is changed.

Remove the commented out experimental code for highlighting the uses of
a particular identifier. The feature was implemented a couple of years
ago, and then commented out experimental code no longer serves any
purpose.
Refactor ftdetect/gofiletype.vim so that it _only_ sets filetype; it no
longer sets fileformat or fileencoding. fileformat and fileencoding are
now set by autocmd events configured in plugin/go.vim

Move most functions called by autocmd events into autoload/go/auto.vim.
The only exceptions are s:gofiletype_pre and s:gofiletype_post in
plugin/go.vim.

Consistently use `setfiletype`; previously `set filetype` was used for
gohtmltmpl and gomod files.

Change s:gofiletype_pre in plugin/go.vim so that it does not set the
filetype; it's already set in ftdetect/go.vim and setting it again may
cause problems for any user that needs to set it to something else.

Move the configuration of all autocmd events that occur after the
FileType event into ftplugin files and clear them in undo_ftplugin so
that they will not execute if the filetype is changed.
@bhcleek bhcleek merged commit 0ab5221 into fatih:master Jan 9, 2019
@bhcleek bhcleek deleted the pure-ftdetect branch January 9, 2019 05:15
bhcleek added a commit that referenced this pull request Jan 9, 2019
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.

1 participant