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

A command to remove cache #29

Closed
ofseed opened this issue Dec 20, 2022 · 8 comments
Closed

A command to remove cache #29

ofseed opened this issue Dec 20, 2022 · 8 comments
Labels
enhancement New feature or request

Comments

@ofseed
Copy link

ofseed commented Dec 20, 2022

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

Maybe because I do not delete packages packer downloaded,
lazy always loads plugins from the wrong path.

Describe the solution you'd like

If the cache was wrongly generated, It's hard to debug and find out what's wrong.
Maybe a command with the cache cleaning functionality is necessary.

@ofseed ofseed added the enhancement New feature or request label Dec 20, 2022
@folke
Copy link
Owner

folke commented Dec 20, 2022

That should not be a problem, since lazy resets tha package path.

You can delete the cache at ~/.local/state/nvim/lazy/cache, but that should not be needed.

Can you give more details on what you're trying to achieve?

@ofseed
Copy link
Author

ofseed commented Dec 20, 2022

After modifying the packer's configuration file to lazy's,
I deleted ~/.local/share/nvim/site/packer/, where the packer saves plugins.

Then, I found I could not require() any plugin in my configuration file before the UI started.
(manually loading them after entering neovim with require() usually works)

The error message shows that lazy loads plugins from site/packer/, which the packer uses
before. The message corresponds to lazy's source code file lua/lazy/core/cache.
So I realized lazy generated a cache with a wrong path.

After deleting ~/.local/state/nvim/lazy/cache, lazy works well.

What surprised me most was why lazy loaded plugins from the packer directory.

@folke
Copy link
Owner

folke commented Dec 20, 2022

That could only happen if the original rtp was still present. Should not happen with lazy's default settings. Did you change those?

@musjj
Copy link

musjj commented Dec 20, 2022

Have you deleted ~/.config/plugin/packer_compiled.lua?

@folke
Copy link
Owner

folke commented Dec 20, 2022

that also should not cause issues, since I prevent that file from being loaded. But it must indeed be something like that what was happening.

Most likely the RTP path that contained other paths.

Did you have packadd packer still somewhere lingering?

@ofseed
Copy link
Author

ofseed commented Dec 20, 2022

That could only happen if the original rtp was still present. Should not happen with lazy's default settings. Did you change those?

Neither

@ofseed
Copy link
Author

ofseed commented Dec 20, 2022

I loaded packer_compile from a custom position, not sure whether it is important,
but I indeed manually deleted it.

This may be a hard-to-reproduce error, if you have no clue, you can close this issue first.

@folke
Copy link
Owner

folke commented Dec 21, 2022

ah yes, that would have been the problem. the packer compiled file would have updated the rtp, hence the behavior you noticed.

I prevent loading the default location of packer_compiled, but if you changed that, it would have still been loaded

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

No branches or pull requests

3 participants