utilyre / barbecue.nvim

Visual Studio Code inspired breadcrumbs plugin for the Neovim editor
MIT License
776 stars 31 forks source link

Entries are always truncated if custom section includes whitespace separator (%=) #79

Closed williamboman closed 1 year ago

williamboman commented 1 year ago

Hello! Since 59f96560c659a79dba941efac25ed6e20c369375, barbecue entries are always truncated because I've configured custom_section to be prefixed with %= so that it is right-aligned. This results in custom_section_length to be very large because it includes a bunch of leading spaces (the padding necessary to right-align it), effectively triggering truncation every time.

Not sure what the best way to work around this would be. After looking into the code my first idea was that it might be best to construct the complete winbar and nvim_eval_statusline() it to see if truncation needs to be applied. The winbar already rearranges items in case it overflows, so another option would be to simply not do any custom truncation at all and delegate that to Neovim.

Thanks!

williamboman commented 1 year ago

Here's a screenshot to illustrate this:

Screenshot 2023-04-12 at 23 28 04

The sw=2 et tw=0 to the right is my custom_section, which are right-aligned via %=.

utilyre commented 1 year ago

Hi! custom_section is right aligned by default, you don't need an extra %=.

williamboman commented 1 year ago

Hi! custom_section is right aligned by default, you don't need an extra %=.

Aha!