Adding + 2 removes the shift. Since it's nice to give a visual clue when text gets truncated, I added the ellipsis character. I followed the assignment to a variable, which was done in another place. But it's called just twice here, so please let me if you prefer to have it changed.
I hoped tuning the offset truncation might fit as a followup to #414
Truncated text get a bit shifted. The reason for this is afaik found on: https://github.com/tobealive/barbar.nvim/blob/f31c82d6667f503de558b033006f1426ee169dc7/lua/barbar/render.lua#L677
Adding
+ 2
removes the shift. Since it's nice to give a visual clue when text gets truncated, I added the ellipsis character. I followed the assignment to a variable, which was done in another place. But it's called just twice here, so please let me if you prefer to have it changed.