romgrk / barbar.nvim

The neovim tabline plugin.
2.2k stars 81 forks source link

fix: animations #418

Closed romgrk closed 1 year ago

romgrk commented 1 year ago

A few things happening here:

@Iron-E This might conflict with some of your changes but I'd rather we merge this first, these changes will help us maintain the plugin better.

romgrk commented 1 year ago

@Iron-E @tobealive I have reverted some of the offset truncation changes, they were causing issues and I didn't want to debug here.

Screenshot from 2023-04-02 20-33-20

Regarding the changes, I also think they weren't optimal, the groups functions are meant to be as pure as possible, we shouldn't add render-specific logic in them, they're here to slice stuff that has already been computed. If we want to add an ellipsis, it should be computed at the layout phase.

A good next refactoring step could be to extract all of them into lua/barbar/groups.lua.

Iron-E commented 1 year ago

68 might be a good replacement for the ellipsis functionality anyway

ttytm commented 1 year ago

I have reverted some of the offset truncation changes, they were causing issues and I didn't want to debug here.

Thanks for the info @romgrk! Should have checked better that this isn't just handling the sidebar offset. But this re-introduced a shifted offset on truncation. Should there be some separate handling of the sidebar offset truncation or will #68 tackle this as well? Let me know if I can help out somehow.

romgrk commented 1 year ago

We should add the truncation logic again, but it should be handled outside of slice_groups_right, which is too low-level for this kind of logic.