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

Unknown option: cfg #345

Closed
zenixls2 opened this issue Aug 28, 2019 · 3 comments · Fixed by #346
Closed

Unknown option: cfg #345

zenixls2 opened this issue Aug 28, 2019 · 3 comments · Fixed by #346

Comments

@zenixls2
Copy link

  • rust.vim version: git commit f45cdae
    Steps to reproduce:

mine installation is through vim-plug.
by changing the order of these two lines, different results will occur:

Plug 'rust-lang/rust.vim'
Plug 'cespare/vim-toml'

Expected vs. actual behavior:

if vim-toml is loaded before rust.vim, no error will occur.
otherwise, vim will output something like:

"Cargo.toml" 10L, 252C
Error detected while processing FileType Auto commands for "*":
E518: Unknown option: cfg

and vim-toml will be ignored (no color for the script).
The error message is produced by this line
vim version is

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 18 2016 14:42:40)

Paste debugging info from the Rust Vim plugin via one of the following
commands: :RustInfo, :RustInfoToClipboard, or :RustInfoToFile <filename>.

these won't work.

@mhinz
Copy link
Contributor

mhinz commented Aug 28, 2019

You didn't mention the Included patches bit from vim --version, but you probably have a version older than 8.0.0613, which is the commit that introduced the FALLBACK syntax.

As for the order issue: When cespare/vim-toml is run first, it sets the filetype to toml and thus the :setfiletype from this plugin will return early without ever processing its arguments.

@zenixls2
Copy link
Author

the version I used is 8.0.003-1 provided in Ghettoforge Plus repo in CentOS 7.
the default verson in main repo is at 7.4

Is there any possibility to do the version check before to prevent this issue?
Or maybe we need to add a dependency requirement of version 8.0.0613 in README.

@mhinz
Copy link
Contributor

mhinz commented Aug 28, 2019

The above PR should fix it for you.

chris-morgan pushed a commit that referenced this issue Aug 30, 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
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 a pull request may close this issue.

2 participants