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

Fix ftdetect #1645

Merged
merged 1 commit into from
Jan 15, 2018
Merged

Fix ftdetect #1645

merged 1 commit into from
Jan 15, 2018

Conversation

ichizok
Copy link
Contributor

@ichizok ichizok commented Jan 11, 2018

When sourcing ftdetect/*.vim (in $VIMRUNTIME/filetype.vim), augroup filetypedetect is already set.

Thus using augroup in ftdetect script, autocmds in gofiletype.vim and in other ftdetect scripts sourced after gofiletype.vim do not belong to augroup filetypedetect.
This makes some behaviors about filetype (e.g. :filetype off) broken.

Should not use augroup in ftdetect script (see `:help ftdetect`)
@codecov-io
Copy link

codecov-io commented Jan 11, 2018

Codecov Report

Merging #1645 into master will increase coverage by 1.43%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1645      +/-   ##
==========================================
+ Coverage   17.77%   19.21%   +1.43%     
==========================================
  Files          57       53       -4     
  Lines        4770     4153     -617     
==========================================
- Hits          848      798      -50     
+ Misses       3922     3355     -567
Flag Coverage Δ
#nvim 14.54% <0%> (+1.27%) ⬆️
#vim74 17.6% <0%> (+1.22%) ⬆️
#vim80 18.37% <0%> (+1.32%) ⬆️
Impacted Files Coverage Δ
ftdetect/gofiletype.vim 0% <0%> (ø) ⬆️
plugin/go.vim 29.26% <0%> (-4.26%) ⬇️
autoload/go/test.vim 69.51% <0%> (-2.93%) ⬇️
autoload/go/util.vim 60.51% <0%> (-1.37%) ⬇️
autoload/go/guru.vim 9.6% <0%> (-0.36%) ⬇️
ftplugin/go/commands.vim 0% <0%> (ø) ⬆️
syntax/godebugvariables.vim
syntax/godebugstacktrace.vim
autoload/go/debug.vim
syntax/godebugoutput.vim

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ceecc2...f4c4044. Read the comment docs.

@fatih
Copy link
Owner

fatih commented Jan 13, 2018

Thanks @ichizok

This is from the help doc :help ftdetect:

Note that there is no "augroup" command, this has already been done
when sourcing your file.  You could also use the pattern "*" and then
check the contents of the file to recognize it.

I've looked at the Git history and the change was introduced by @Carpetsmoker. I assume you must be right (according to the doc) but let me ping him as well.

@arp242
Copy link
Contributor

arp242 commented Jan 15, 2018

Yeah, this change seems okay 👍 I didn't know that ftdetect already wrapped stuff in an augroup.

@arp242 arp242 merged commit 30d04ad into fatih:master Jan 15, 2018
@ichizok ichizok deleted the fix/ftdetect branch January 15, 2018 13:32
amadeus pushed a commit to pangloss/vim-javascript that referenced this pull request Aug 14, 2019
This is from the help doc :help ftdetect:

Note that there is no "augroup" command, this has already been done
when sourcing your file.  You could also use the pattern "*" and then
check the contents of the file to recognize it.

Reference:
Vimjas/vint#264
fatih/vim-go#1645
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.

4 participants