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

Add to wiki/documentation for how multiple options (ex 'for' languages) are parsed #1196

Open
JWCS opened this issue Jul 29, 2022 · 0 comments

Comments

@JWCS
Copy link

JWCS commented Jul 29, 2022

Anyway, for option was designed to take a string of a single file type or a list of multiple file types, and there's no code in vim-plug that processes comma-separated file types. It may not work correctly if you have multiple plugins with overlapping sets of for options.

Plug 'foo', { 'for': 'a,b,c' }
Plug 'bar', { 'for': 'b,c' }

When a file of type a is open, foo is loaded, and vim-plug will try to clear the hook by executing autocmd! PlugLOD Filetype a,b,c, which will cause the autocmds for bar to be cleared as well, and bar will never get loaded.

But if you specify the types as a list, vim-plug will correctly handle such cases.

Plug 'foo', { 'for': ['a', 'b', 'c'] }
Plug 'bar', { 'for': ['b', 'c'] }

Originally posted by @junegunn in #259 (comment)

This was the only (non-source code) documentation I could find on this.
It would be helpful to add this to the wiki/documentation.

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

No branches or pull requests

1 participant