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

Use setfiletype in ftdetect to avoid loading twice. #40

Merged
merged 1 commit into from
Mar 30, 2019

Conversation

averms
Copy link
Contributor

@averms averms commented Mar 16, 2019

This is the "correct" way of doing it and is what the official vim runtime files do

@wsdjeg
Copy link

wsdjeg commented Mar 17, 2019

but it is same as au BufRead,BufNewFile *.rkt,*.rktl set filetype=racket becasuse in this automd there is only one line vim script.

@averms
Copy link
Contributor Author

averms commented Mar 17, 2019

but it is same as au BufRead,BufNewFile .rkt,.rktl set filetype=racket becasuse in this automd there
is only one line vim script.

If, in the future, the official vim distribution adds racket to filetype.vim then our ftdetect will
source the racket stuff twice which slows down loading and could break things. You are right that this doesn't help now, but it might help in the future (plus there is no cost). The rust.vim maintainers had to deal with this.

@wsdjeg
Copy link

wsdjeg commented Mar 17, 2019

no,because this are two different autocmd.

@wlangstroth wlangstroth merged commit c08b635 into wlangstroth:master Mar 30, 2019
@wlangstroth
Copy link
Owner

Thanks!

@jubnzv
Copy link
Contributor

jubnzv commented Apr 3, 2019

Strange, but this commit breaks filetype detection in clean neovim (v 0.4.0) setup.
Should I also add this autocommand in my neovim configuration?

@averms
Copy link
Contributor Author

averms commented Apr 3, 2019

Strange, but this commit breaks filetype detection in clean neovim (v 0.4.0) setup.

Oh fuck you're right I'm really dumb. We do need to override vim's official files in this case because they set *.rkt as scheme.

@wlangstroth can you revert?
Maybe we should add a comment that says why we are using the filetype= way of doing it.

This was referenced May 22, 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.

None yet

4 participants