ayamir / nvimdots

A well configured and structured Neovim.
BSD 3-Clause "New" or "Revised" License
2.84k stars 455 forks source link

"disabled_plugins" setting won't work for forked plugins #1077

Closed YuCao16 closed 7 months ago

YuCao16 commented 7 months ago

Version confirmation

Following prerequisites

Not a user config issue

Neovim version

NVIM v0.10.0-dev-618+g4fd852b8c

Operating system/version

Ubuntu 23.10

Terminal name/version

kitty 0.28.1

$TERM environment variable

xterm-kitty

Branch info

main (Default/Latest)

Fetch Preferences

SSH (use_ssh = true)

How to reproduce the issue

  1. fork a plugin's repo, for example nvimdev/lspsaga.nvim as username/lspsaga.nvim, and add it to user/plugins/completion.lua, and in settings, add settings["disabled_plugins"] = {"nvimdev/lspsaga.nvim"}.
  2. Restart neovim and run Lazy update
  3. Enter neovim and run command Lspsaga xxx
  4. It will return not a known command

Expected behavior

The nvimdev/lspsaga.nvim will be disabled, and I will use username/lspsaga.nvim.

Actual behavior

Lspsaga xxx is not a known command.

Additional information

This is not a problem of nvimdots actually, it related to lazy.nvim, as nvimdots use disable option to disable the plugin. However, lazy.nvim seems not support such situation. Maybe remove those disabled plugin from here? https://github.com/ayamir/nvimdots/blob/f84f72da4b0054fe8871c70431c5329a621dbb8f/lua/core/pack.lua#L40-L44

Let me known if you need more steps to reproduce!

ayamir commented 7 months ago

Can not understand the meaning of folded. The problem is lazy.nvim store all plugins in ~/.local/share/nvim/site/lazy using just the plugin name (lspsaga.nvim) rather than with the author name (nvimdev/lspsaga.nvim). So it won't clone the forked repo because their names are the same.

Jint-lzxy commented 7 months ago

I think u should first do :Lazy clean (or <leader>px) without including any forks of the plugin in ur spec, and then :Lazy sync all plugins again (now with the fork u would like to include). As @ayamir mentioned, lazy.nvim will only use existing caches (located under ~/.cache/nvim/luac) when not explicitly asked to perform cleanup. But on the disk, plugins are distinguished only by their repo names (unless overwritten using the name field), so using two plugins with the same repo name without asking for (prior) explicit cleanup would confuse lazy.nvim.

YuCao16 commented 7 months ago

Can not understand the meaning of folded. The problem is lazy.nvim store all plugins in ~/.local/share/nvim/site/lazy using just the plugin name (lspsaga.nvim) rather than with the author name (nvimdev/lspsaga.nvim). So it won't clone the forked repo because their names are the same.

Typo, sorry for the confusion.

YuCao16 commented 7 months ago

I think u should first do :Lazy clean (or <leader>px) without including any forks of the plugin in ur spec, and then :Lazy sync all plugins again (now with the fork u would like to include). As @ayamir mentioned, lazy.nvim will only use existing caches (located under ~/.cache/nvim/luac) when not explicitly asked to perform cleanup. But on the disk, plugins are distinguished only by their repo names (unless overwritten using the name field), so using two plugins with the same repo name without asking for (prior) explicit cleanup would confuse lazy.nvim.

Seems not work. I understand the way lazy.nvim deal with plugin with enabled = false. Can we just remove those disabled plugins by remove them from plugins_list instead of using enabled opt?

ayamir commented 7 months ago

https://github.com/ayamir/nvimdots/pull/1079#issuecomment-1831786288