nanozuki / tabby.nvim

A declarative, highly configurable, and neovim style tabline plugin. Use your nvim tabs as a workspace multiplexer!
MIT License
563 stars 21 forks source link

Fix: Render issues when no defined file icon exists in nvim-web-devicons #103

Closed 007Psycho007 closed 1 year ago

007Psycho007 commented 1 year ago

When trying to use File_Icon function with unknown Filetypes like NvimTree the Tabby line wasnt rendering properly Example Configuration:

` line.wins_in_tab(line.api.get_current_tab()).foreach(function(win) local hl = win.is_current() and theme.current_tab or theme.inactive_tab return { line.sep('', hl, theme.fill), win.file_icon(), win.buf_name(), line.sep('', hl, theme.fill), hl = hl, margin = ' ', }

` Before image

Adding the default value to the call of Devicon function fixes this.

After image

P.S. I screwed up the the branch of the previous PR. That's why I'm redoing this one.

nanozuki commented 1 year ago

It seems that both icon and filename disappeared. Allow me to do some tests on this issue.

nanozuki commented 1 year ago

Both icon and filename disappeared because the get_icon returned nil. The lua array has been truncated. So yes, this is very helpful, thank you!