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

:setfiletype FALLBACK is not available in older versions #346

Merged
merged 1 commit into from Aug 30, 2019
Merged

:setfiletype FALLBACK is not available in older versions #346

merged 1 commit into from Aug 30, 2019

Conversation

mhinz
Copy link
Contributor

@mhinz mhinz commented Aug 28, 2019

There is no workaround for this. If we would set the filetype first via :set filetype=cfg or :setfiletype cfg, more specialized plugins like vim-toml, wouldn't be able to overwrite the filetype with :setfiletype toml anymore.

Now, we simply don't set a filetype at all for older Vim versions. Not great, but better than an error that keeps rust.vim from getting sourced properly.

Fixes #345


Alternative: We remove the entire line. If someone wants syntax highlighting for toml, vim-toml should be used.

p.s. Works with Vim and Nvim.
p.p.s This is the recommended approach for checking versions (in older Vim verions): :h has-patch.

@rust-highfive
Copy link

r? @chris-morgan

(rust_highfive has picked a reviewer for you, use r? to override)

ftdetect/rust.vim Outdated Show resolved Hide resolved
There is no workaround for this. If we would set the filetype first via `:set
filetype=cfg` or `:setfiletype cfg`, more specialized plugins like vim-toml,
wouldn't be able to overwrite the filetype with `:setfiletype toml` anymore.

Now, we simply don't set a filetype at all for older Vim versions. Not great,
but better than an error that keeps rust.vim from getting sourced properly.

Fixes #345
@chris-morgan chris-morgan merged commit e99f3f5 into rust-lang:master Aug 30, 2019
@mhinz mhinz deleted the cargo-ft-fallback branch August 30, 2019 09:39
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.

Unknown option: cfg
3 participants