lazy.nvim icon indicating copy to clipboard operation
lazy.nvim copied to clipboard

fix: catch errors setting up rtp when plugin not installed

Open BlueDrink9 opened this issue 2 years ago • 5 comments

I was getting E5108 sometimes when a plugin that loads on start wasn't installed. That interrupted Lazy's load, preventing me from then using it to install the missing plugin. On Windows it happened every time, on Linux it was about every 2nd time.

I'm hoping I've figured out enough of the codebase conventions for this to be written appropriately, but it was only a quick skim so apologies if I've missed an internal logging function.

BlueDrink9 avatar Nov 22 '23 18:11 BlueDrink9

I'm a bit hesitant to merge this, since this really should never trigger an error.

What was the exact error you get?

folke avatar Jan 21 '24 10:01 folke

That's what I expected too, and yet it happened consistently. I should note that if automatic installation was enabled, I could usually get around this.

I can't recall the exact error, but it was a neovim error relating to an error in setopt while setting rtp.

It may have had something to do with how I set up Lazy, but I'm using it through more or less the lazyvim recommended way, albeit from a custom rtp lua folder stored in dotfiles. Now I think about it.

Welcome back! Hope you had a great vacation, thanks for taking the time to go back and address all these tickets.

BlueDrink9 avatar Jan 21 '24 18:01 BlueDrink9

Personally I feel a small error catching line that solves someone's odd problem is a "may as well" merge. However, I recognise that you have your own standards for codebase tidiness and that you can't trust random users, so I'm happy to keep the discussion going about whether you merge. It'd make my use of lazy a lot easier if it is though

BlueDrink9 avatar Jan 21 '24 18:01 BlueDrink9

I hadn't realised how generic E5108 is, oops. I should have included the error message. I'll see if I can repro

BlueDrink9 avatar Jan 21 '24 18:01 BlueDrink9

Yeah, E5108 is indeed a very general lua error, so would be good to see what the exact message was you got.

folke avatar Jan 21 '24 19:01 folke