-
Notifications
You must be signed in to change notification settings - Fork 42
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
Be more tolerant about plugin name conflicts #163
Comments
+1 |
+1, is the issue resolved ? |
Nope! We have more projects than contributors so progress is slow. As a workaround, you could add an addon-info.json file to one of hte plugins to give it a different unique name. For instance, in the case of fzf.vim, the plugin name is supposed to include the ".vim", so we can explicitly configure the name as "fzf.vim": echo '{ "name": "fzf.vim" }' > fzf.vim/addon-info.json Longer term, @malcolmr, WDYT about making it never fail but in the general case append a unique numeric index? Example: Plug 'whatever/foo'
Plug 'yet-another/foo
echo maktaba#plugin#RegisteredPlugins() Would print: We could also make smarter heuristics for guessing plugin names so that if you already have "fzf" installed and then install "fzf.vim", it'll keep the full name "fzf.vim", but that'll probably end up being order-dependent behavior and sometimes giving you "fzf" and "fzf2". |
Thanks @dbarnett , the workaround works for me. |
Yes, fzf.vim adding an adding an In general: sounds like that uniquifying the plugin name might work. It would mean that (In this case I guess we're mostly talking about plugins that aren't aware of Maktaba at all(?), so nobody would be calling I note that this behaviour is actually documented; see https://github.com/google/vim-maktaba/blob/ec7a094/autoload/maktaba/plugin.vim#L304-L307. |
Hmm, now that you mention it, generally you won't have conflicting plugins that are both using maktaba, and plugins do assume they'll be able to look up their own plugin object by plugin name. Preferably a plugin that doesn't use maktaba at all wouldn't conflict with a maktaba plugin at all. What about if we make a "soft"/lazy registration for plugins without an explicit name? Then we'd only try to disambiguate when you access the plugin object via |
That sounds reasonable, I think. Certainly I agree with the principle that non-Maktaba-using plugins shouldn't conflict with anything, if possible. (Also, we can add |
Yep, but plugin name references from the outside don't help disambiguate, so these implicit strategies might still run into an unavoidable conflict if something looks up the plugin from the outside before the right plugin initializes. |
Adding two plugins with the same canonical name to
&rtp
breaks Maktaba's plugin detection completely, reporting e.g.However, it seems like we should be able to deal with this more tolerantly and ignore the second one, not just completely fail.
(The real case I'm looking at is using both https://github.com/junegunn/fzf and https://github.com/junegunn/fzf.vim, which seems reasonable.)
The text was updated successfully, but these errors were encountered: