Closed m147 closed 4 months ago
I wasn't able to reproduce. Does this icon appear when using nvim-web-devicons in other plugins?
I don't think I have any other plugins that use nvim-web-devicons. I have NERDTree which uses another devicon plugin. I tried removing that plugin to see if there is a conflict but that was not the issue.
Can you run this from a txt file and share the result?
require('nvim-web-devicons').get_icon_by_filetype(vim.api.nvim_get_option_value('filetype', {}))
(I'm on a phone so the syntax might not be 100% accurate, if it doesn't work I'll post a working version tomorrow)
Can you run this from a txt file and share the result?
require('nvim-web-devicons').get_icon_by_filetype(vim.api.nvim_get_option_value('filetype', {}))
(I'm on a phone so the syntax might not be 100% accurate, if it doesn't work I'll post a working version tomorrow)
You mean open a text file and run the above as a vim commad?
Can you run this from a txt file and share the result?
require('nvim-web-devicons').get_icon_by_filetype(vim.api.nvim_get_option_value('filetype', {}))
(I'm on a phone so the syntax might not be 100% accurate, if it doesn't work I'll post a working version tomorrow)
You mean open a text file and run the above as a vim commad?
Yeah; whenever a file is currently focused that has the bug from the screenshot.
You can do := some_lua_code_here
in recent Neovim versions for that.
Sorry for any confusion!
No worries, I hadn't included the = when running the command. This doesn't do anything that I can see.
No worries, I hadn't included the = when running the command. This doesn't do anything that I can see.
What version are you on? It might be necessary to do :lua vim.pretty_print(expression_goes_here)
instead.
Alternatively, checking :messages
might reveal the output
Version: NVIM v0.9.5 Build type: Release LuaJIT 2.1.1702233742
I tried the above, first it warned me to use vim.print instead of vim.pretty_print as that is deprecated. The output was
I tried making a file foo.text rather that .txt the icon shows properly. Not sure why it doesn't work with .txt. Also, I'm quite sure this is recent. I don't remember seeing this before.
vim.pretty_print as that is deprecated
Yeah, pretty printing is the old way of doing that. :=
and vim.print
are the new ways
I tried making a file foo.text rather that .txt the icon shows properly
My present ideas as to a cause are:
setup
(could either be causing it or fix it);ftdetect
issue (since since you said .text works)Does this line show in Neovim properly? If so, that eliminates the notion that this is a font issue and makes it more likely to be a filetype error.
It does not. Shows the same box as in barbar
I'm able to get the icon working properly with:
require'nvim-web-devicons'.setup { override_by_extension = { ["txt"] = { icon = "", color = "#81e043", name = "txt" } }; }
in init.vim
It seems this is an issue with nvim-web-devicons and not barbar.
I should have read this notice on its GitHub page:
Notice Nerd fonts moved some symbols with version 3.0. Version 2.3 is meant for transition, supporting both version 2 and version 3 icons. Nvim-web-devicons requires version 2.3 or above to work properly. If you are unable to update please use your plugin manager to pin version of nvim-web-dev icons to nerd-v2-compat tag.
Plug 'kyazdani42/nvim-web-devicons', { 'tag': 'nerd-v2-compat' }
solves the issue.
One way or another, you helped me track down where the issue lies. Thank you.
Happy to help!
Barbar does not display devicon for .txt files. Displays only []
To Reproduce
Screenshots![barbar_txt](https://github.com/romgrk/barbar.nvim/assets/23084850/9af0be23-2cb9-43f7-94dd-b1ad25d66aff)