Closed DMunkei closed 1 year ago
Please show the output from :checkhealth diffview
.
diffview: require("diffview.health").check()
========================================================================
## Checking plugin dependencies
- OK: plenary installed.
- WARNING: Optional dependency 'nvim-web-devicons' not found.
## Checking external dependencies
- OK: Git found.
- OK: Git is up-to-date.
Here's also the line in my packer.lua
that is pulling the dependency
use {'nvim-lualine/lualine.nvim',
requires = { 'kyazdani42/nvim-web-devicons', opt = true }
}
You're pulling it as an opt
dependency. Thus it will not be available on the 'runtimepath'
until either you, or packer add it with :packadd
.
Either don't install it as opt
, or declare it as a dependency in diffview's packer spec as well.
I tried doing this :
use { 'sindrets/diffview.nvim',
requires = {'nvim-lua/plenary.nvim', 'kyazdani42/nvim-web-devicons', opt = true}
}
However, that didn't seem to work. I tried doing it like you mentioned with :packadd nvim-web-devicons
and then opened DiffViewOpen
. Then that worked. My question is, where would I add :packadd nvim-web-devicons
?
It's a library. I don't understand why you want to lazy load it. It doesn't do anything until another plugin calls its API.
If, for whatever reason, it's really important to you to lazy load it, then I'll leave it up to you to figure out when it should be :packadd
-ed. It has to happen at least before the first time you call any of diffview's commands.
It's a lot simpler if you don't care about lazy loading it:
use {
"sindrets/diffview.nvim",
requires = {
"nvim-lua/plenary.nvim",
"kyazdani42/nvim-web-devicons",
},
}
No reason at all, I took it from the package docs. I just changed it to your proposed suggestion. However, it still requires me to do a manual :packadd nvim-web-devicons
for it to work. I had to also remove the opt = true
in the other import I had. Works properly now.
use { 'nvim-lualine/lualine.nvim',
requires = { 'kyazdani42/nvim-web-devicons'}
}
use {
'sindrets/diffview.nvim',
requires = {
'nvim-lua/plenary.nvim',
'kyazdani42/nvim-web-devicons'
},
}
Right. A packer dependency can't be declared multiple times with different specs. That seems like a limitation in packer. You could raise that issue upstream if you want it addressed.
Closing, as the original problem has been solved.
@DMunkei btw the repo is called nvim-tree/nvim-web-devicons
now. The old name still links to the repo but just to be explicit, I'd use the new repo name
@tummetott Thanks, changed it.
I saw in the changelog
changelog-271
that changes to the settings had to be done. I didn't have anything special in my settings, just the standard example written in theREADME
. I simply exchanged it with the current example in theREADME
. However, I am getting this error:[Diffview.nvim] nvim-web-devicons is required to use file icons! Set "use_icons = false" in your config to stop seeing this message.
I have the dependency installed, not sure what's the issue here?