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

FIX: plugin declaration can be overwitten. #127

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

niw
Copy link
Contributor

@niw niw commented Nov 14, 2023

Problems

When jetpack#add is called with same name's plugin, it checks against a:plugin that may inclues GitHub user name such as tani/jetpack, but key for s:declared_packages is plugin name such as jetpack, which is inconsistent.

Due to this issue, when the Lua API is used with requires, for example, it calls same plugin name to use(req) call at line around 853, which may override already declared plugin.

Solution

Use plugin name always for s:declared_packages.
This patch also includes minor indent fix.

**Problems**

When `jetpack#add` is called with same name's plugin,
it checks against `a:plugin` that may inclues GitHub user name
such as `tani/jetpack`, but key for `s:declared_packages` is
plugin name such as `jetpack`, which is inconsistent.

Due to this issue, when the Lua API is used with `requires`,
for example, it calls same plugin name to `use(req)` call
at line around 853, which may override already declared plugin.

**Solution**

Use plugin name always for `s:declared_packages`.
This patch also includes minor indent fix.
@tani
Copy link
Owner

tani commented Nov 15, 2023

Thank you so much!

@tani tani merged commit 245d6cb into tani:main Nov 15, 2023
8 checks passed
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.

2 participants