rebelot/heirline.nvim

Dies in various ugly ways when terminals get scrunched too small

Closed this issue · 2 comments

First, it's pretty clear that making the plugin robust to resizing nvim window to any dimension should be a requirement.

  • some terminals such as Wezterm I configure to fullscreen on start and set the font size, but neither of these configuration options get applied until after the ssh/tmux attach takes place, which means that for a split second the default small dimension huge font window exists, squishing tmux panes during this time
  • I may have an nvim open with multiple vertical split tabs open which makes this situation really easy to trigger
  • I also tend to occasionally attach to tmux from my phone which will cause many nvims to immediately get resized to single digit width terminals

heirline will cause one of a few possible failure modes when any single pane in a nvim window becomes too narrow:

  • Display error and completely lock up nvim requiring kill -9
  • Display error and give up from then on (statusline becomes a bone standard statusline)

This is the most unstable part of my neovim setup and I would ordinarily ditch the plugin for another one but i've already invested a lot of time into the heirline statusline i use now and I also really like everything else about it, so I'm willing to try to find a solution.

Heres an example of the latter style of error (the first style I do not know how to exfiltrate the error because it hangs the entire program):

E5108: Error executing lua /home/slu/.config/nvim/lua/heirline_conf/heirline.lua:229: attempt to concatenate a nil value
stack traceback:
        /home/slu/.config/nvim/lua/heirline_conf/heirline.lua:229: in function 'provider'
        ...hare/nvim/lazy/heirline.nvim/lua/heirline/statusline.lua:348: in function '_eval'
        ...hare/nvim/lazy/heirline.nvim/lua/heirline/statusline.lua:365: in function '_eval'
        ...hare/nvim/lazy/heirline.nvim/lua/heirline/statusline.lua:440: in function 'eval'
        ...hare/nvim/lazy/heirline.nvim/lua/heirline/statusline.lua:530: in function 'expand_or_contract_flexible_components'
        ...ocal/share/nvim/lazy/heirline.nvim/lua/heirline/init.lua:113: in function <...ocal/share/nvim/lazy/heirline.nvim/lua/heirline/init.lua:104>

Oh oh I forgot, this error is from my own heirline code. I got rid of it and no more issue. sorry about that

gg