Closed Drogglbecher closed 4 months ago
So sorry! Currently I am upgrading the project. Currently this project is compatible with nvim-tree, lualine, bufferline... so you don't need to overwrite icons anymore. Now the project is running fine on my machine. If you still get the error, please let me know more details about your plugins/init.lua file. Thank!
Thanks for your quick repsonse :)
If I got you correct, I just need the standard nvim-tree (not your fork) and nvim-material-icon, right? So I plainly put
"DaikyXendo/nvim-material-icon"
in the plugins/init.lua
file without further config as described in the readme, removed DaikyXendo/nvim-web-devicons
and use the nvim-tree/nvim-tree
plugin.
However when opening the nvim-tree I get
Error executing Lua callback: ...vim-tree.lua/lua/nvim-tree/renderer/components/icons.lua:68: attempt to call fiel
d 'get_default_icon' (a nil value)
stack traceback:
...vim-tree.lua/lua/nvim-tree/renderer/components/icons.lua:68: in function 'get_file_icon'
...im/lazy/nvim-tree.lua/lua/nvim-tree/renderer/builder.lua:186: in function 'build_file'
...im/lazy/nvim-tree.lua/lua/nvim-tree/renderer/builder.lua:338: in function 'build_line'
...im/lazy/nvim-tree.lua/lua/nvim-tree/renderer/builder.lua:385: in function 'build_lines'
...im/lazy/nvim-tree.lua/lua/nvim-tree/renderer/builder.lua:438: in function 'build'
.../nvim/lazy/nvim-tree.lua/lua/nvim-tree/renderer/init.lua:57: in function 'draw'
...ocal/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/lib.lua:195: in function 'open_view_and_draw'
...ocal/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/lib.lua:259: in function 'open'
...lazy/nvim-tree.lua/lua/nvim-tree/actions/tree/toggle.lua:48: in function 'toggle'
...share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/commands.lua:98: in function <...share/nvim/lazy/nvim-tree.
lua/lua/nvim-tree/commands.lua:97>
I went back to my lazy-nvim file and found the problem. Previously I had an error with nvim-tree
so I placed it in the specified commit. Now both nvim-tree
and nvim-web-devicons
have been upgraded.
I'm trying my best to make it compatible with the latest nvim-tree
. In the meantime you can use my nvim-tree repo or use:
{ "nvim-tree/nvim-tree.lua", commit = "c3c6544ee00333b0f1d6a13735d0dd302dba4f70" },
So I took your nvim-tree implementation. However, I don't see any icons but this plain file thingies:
The icons in the tabline and lualine are shown correctly btw.
What I ended up doing was forking the project in order to rename the Lua module lua/nvim-web-devicons.lua -> lua/nvim-material-devicons.lua
This way I could have all my plugins using their normal dependencies, example:
{
"nvim-tree/nvim-tree.lua",
dependencies = { "nvim-tree/nvim-web-devicons" }
}
And all I had to do was overwire the nvim-web-devicons
with the material ones:
{
"nvim-tree/nvim-web-devicons",
dependencies = { "FotiadisM/nvim-material-icon" },
config = function()
require("nvim-web-devicons").setup({
override = require("nvim-material-devicons").get_icons(),
})
end,
},
This is a much easier approach to me, there is no need to use a forked version of nvim-tree or specific commits on plugins. Not sure if my method is 100% correct but I haven't encountered a bad icon so far. Of course the downside is that you have to import both plugins
In the latest version my project supported nvim-tree latest version. I plan to close this issue tomorrow. Thank!
Hi, I did an update this morning and since then I get this error message:
Changing to your version of nerd-tree or nvim-web-devicons doesn't change the behaviour. The part of
plugins/init.lua
looks like this:Do I do anything wrong here? The only thing I'm not 100% sure with is the latest nerd font. I use the brew cask and update it on a daily base, so basically this shouldn't be the problem, should it?