Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Removing modules only leads to error messages #133

Closed
mcctuxic opened this issue Sep 25, 2021 · 3 comments
Closed

Removing modules only leads to error messages #133

mcctuxic opened this issue Sep 25, 2021 · 3 comments
Labels
good first issue Good for newcomers scope: bug Something isn't working status: help wanted Extra attention is needed

Comments

@mcctuxic
Copy link

When disabling some modules via doom_modules lua and restarting nvim, the user is shown a message asking "Remove module
xyz Y/N?" (or something like that). If this YES is given, the modules will be remove physically from the harddisk/SSD/whatever.
Restarting nvim then leads to a lot of low lever error messages about missing things.
This could be fixed with a run of PackerCompile -- if the user knows, what to do.
Suggestion:
Run PackerCompile automatically, if the question above is answered with Yes and/or modules get removed physically.

@osamuaoki
Copy link
Contributor

"Run PackerCompile automatically always upon nvim's start", beat the purpose. It is meant to speed up start up process by pre-calculating slow RTP searching.

But I also understand iffy feeling of getting error messages. So there should be some checks and if needed, run sync and compile, I suppose.

If (packer_compile.lua is missing) or ((any of the user configs) are newer than packer_compile.lua) then

  • install packer if needed
  • sync
  • compile

This is in the early part of root init.lua before packer_compile.lua is run as plugin.

I don't know but I think this is a reasonable thing. Is there any reason why this is not done?

@NTBBloodbath NTBBloodbath added scope: bug Something isn't working good first issue Good for newcomers status: help wanted Extra attention is needed labels Sep 26, 2021
@osamuaoki
Copy link
Contributor

I now have a patch to reduce this headache.

Basically, whenever module related changes are made, remove users are advised to remove packer_compiled.lua and run nvim for a update cycle (which loads no opt packages). After successful automatic install, restart nvim.

Since we have some start packages such as galaxyline, we get a bit of noise but far less. Also, users are not required to run Packer command manually.

NTBBloodbath added a commit that referenced this issue Oct 6, 2021
@NTBBloodbath
Copy link
Collaborator

Hey so I think I have some good news on this. Added an autocommand in VimLeavePre to run PackerCompile if doom_modules.lua or doom_userplugins.lua files were modified and this works like a charm to me, no more errors on this!

Please give it a try if you can and feel free to reopen this if you're still facing this error. Added this to development branch first because it is "experimental", if it success then I'll cherry pick the commit to main branch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers scope: bug Something isn't working status: help wanted Extra attention is needed
Projects
None yet
3 participants