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(ui): don't lazy-load dashboard-nvim #3107

Merged
merged 1 commit into from
May 12, 2024

Conversation

mangkoran
Copy link
Contributor

As nvimdev/dashboard-nvim#450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin.

Not really sure if this is enough to make dashboard-nvim not lazy-loaded.

@rubiin
Copy link
Contributor

rubiin commented May 5, 2024

I think that should work .
Other place which would by default enforce lazyloading would be

  defaults = {
    lazy = false, -- should plugins be lazy-loaded?

but i think its turned off by default.
Also it would be better to leave the link nvimdev/dashboard-nvim#450 as a comment on the dashboard plugin spec so as to convey the info

@mangkoran
Copy link
Contributor Author

mangkoran commented May 5, 2024

Thank you for the confirmation. I have updated the branch. Please kindly check :D

@mangkoran mangkoran changed the title fix(ui): unlazy dashboard fix(ui): don't lazy-load dashboard-nvim May 5, 2024
@rubiin
Copy link
Contributor

rubiin commented May 5, 2024

That looks good to me :)

@baod-rate
Copy link

does it make more sense to explicitly disable lazy-loading?

     "nvimdev/dashboard-nvim",
-    event = "VimEnter",
+    lazy = false,
     opts = function()

as we do here:

{
"lervag/vimtex",
lazy = false, -- lazy-loading will disable inverse search

just removing the event param causes the dashboard to not load at all if the user has require("lazy").setup({ defaults = { lazy = true }}. AFAIK no other LazyVim-plugins behave like that

@dpetka2001
Copy link
Contributor

dpetka2001 commented May 9, 2024

But that is not default Lazyvim behavior. Only if the user has explicitly set lazy = true in his config. That means he also has to explicitly set the lazy keyword for all the plugins that he desires a different behavior in my opinion.

@baod-rate
Copy link

Yes, I realize that lazy = true is not the default setup for lazy.nvim. But every other plugin in this repo, AFAIK, is implicitly lazy (whether through an event/keys/cmd) or explicity lazy = true/false. With this change, dashboard-nvim would be the only plugin in LazyVim whose lazy setting depends on the configured default for lazy.nvim. That means it stops working completely if the user sets { defaults = { lazy = true }.

Regardless of whether you think lazy is an acceptable default (I agree it's better to be explicit about it). There's no reason to not set lazy = false for the dashboard-nvim plugin spec (just as with lervag/vimtex spec, above). The plugin simply does not behave correctly if it is lazy-loaded. And if the user really wants, they can still override that setting in their own config.

@dpetka2001
Copy link
Contributor

Sure it definitely doesn't hurt to explicitly set it to lazy = false in that case.

As nvimdev/dashboard-nvim#450, dashboard-nvim
shouldn't be lazy-loaded to properly handle stdin
@mangkoran
Copy link
Contributor Author

mangkoran commented May 10, 2024

@baod-rate updated with your suggestion. That would make more sense :D

@folke folke merged commit 30c9e47 into LazyVim:main May 12, 2024
@folke
Copy link
Collaborator

folke commented May 12, 2024

Thanks

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.

None yet

5 participants