wbthomason / packer.nvim

A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
MIT License
7.72k stars 263 forks source link

Different kind of dependencies on the same plugin #1217

Open j-xella opened 1 year ago

j-xella commented 1 year ago
NVIM v0.9.0-dev-1072+gf113cba3e
Build type: Release
LuaJIT 2.1.0-beta3

git version 2.25.1

Ubuntu

ssh via Putty

Steps to reproduce

use {
  'nvim-lualine/lualine.nvim',
  requires = { 'nvim-tree/nvim-web-devicons', opt = true },
  config = function() ... end
}

use {
  'glepnir/dashboard-nvim',
  event = { 'VimEnter' },
  config = function() ... end,
  requires = { 'nvim-tree/nvim-web-devicons' }
}

Then packersync etc...

Actual behaviour

dashboard fails, because devicons plugin is installed as optional by packer, and dashboard can't find it on startup .

A tactical fix is to remove the opt flag from the lualine requirements, or "use" devicons explicitly.

Expected behaviour

Multiple plugins require devicons. If at least one requires it to be always present, then this is how it should be installed, even if it is optional for some other plugins.

packer files

git st                                                                                                       
On branch master                                                                                                                         
Your branch is up to date with 'origin/master'.                                                                                          

nothing to commit, working tree clean                                                                                                    

git log --oneline -3                                                                                         
1d0cf98 (HEAD -> master, origin/master, origin/HEAD) Fix: Change display headline text to not indicate that all tasks are plugins (#1190)
b134cba Fix job hangs on invalid/missing commands (#1187)                                                                                
ef50f6f fix(interactive): let interactive mode work for remote clients attached to headless instances (#1113)