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

feature: make config.defaults.version overridable #409

Closed
1 task done
alex35mil opened this issue Jan 17, 2023 · 6 comments · Fixed by #410
Closed
1 task done

feature: make config.defaults.version overridable #409

alex35mil opened this issue Jan 17, 2023 · 6 comments · Fixed by #410
Labels
enhancement New feature or request

Comments

@alex35mil
Copy link

Did you check the docs?

  • I have read all the lazy.nvim docs

Is your feature request related to a problem? Please describe.

I assumed that config.defaults.version = "*" is overridable if plugin spec provides version/commit/branch/etc. But apparently, it is not.

Describe the solution you'd like

Make config.defaults.version overridable if a plugin spec explicitly provides version/commit/branch/etc.

Describe alternatives you've considered

At least explicitly mention this behavior in the docs.

Additional context

No response

@alex35mil alex35mil added the enhancement New feature or request label Jan 17, 2023
@folke
Copy link
Owner

folke commented Jan 17, 2023

It is for version, but you have a point that we should ignore the default when any of the props you mentioned is set. Will fix!

@folke
Copy link
Owner

folke commented Jan 17, 2023

It's also already the case for commit and tag. Just not for branch

@jn64
Copy link

jn64 commented May 28, 2023

Just noting here because it was a little confusing to figure out.

I have config.defaults.version = "*", but I wanted to unset it for specific plugins (i.e. use latest git for that plugin, without specifying a commit/tag).

I tried setting version = nil or version = "" in the plugin spec, which didn't work. I guess it just uses the default value again.

Solution was to set branch = "master" (or whatever branch used for development of that plugin) in the plugin spec.

@folke
Copy link
Owner

folke commented May 28, 2023

@jn64 You need to set version=false

I just clarified this in the docs as well

@jn64
Copy link

jn64 commented May 28, 2023

Thanks, that makes more sense!

@folke
Copy link
Owner

folke commented May 28, 2023

fyi: setting something to nil in lua doesn't do anything.

These two tables are exactly the same in lua: {foo = nil} == {}

Lua doesn't have the notion of undefined key/values like javascript,
so for merging tables that can't be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants