You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add workaround for inconsistent statusline eval padding
It seems that neovim applies inconsistent padding when evaluating the
statusline:
- When padding a normal component, e.g. "%5l", then the global fillchars
option is used
- When padding a grouped component with minwid, e.g. "%2(a%)", then the
fillchars parameter for nvim_eval_statusline() is used
It is this inconsistent padding that causes our statusline split
heuristic to mistakenly think that a grouped component is the actual
split of the statusline (like "%="), while it is actually not.
This caused some statuslines (in particular heirline, luckily not many
other popular statuslines use grouped components like this) to have very
weird and early right alignment.
This is obviously not the fault of those statuslines, but it turns out
that this bug is not very easy to fix in upstream neovim.
Ideally we would have API in nvim_eval_statusline() that would tell us
the split point directly, then we could avoid these nasty heuristics
altogether.
So instead I came up with a workaround in the meantime. Keep in mind,
this workaround is absolutely horrid, but at least it works. Hopefully
we can resolve this problem properly, but for now I have added a unit
test to make sure that we don't regress this further.
Also fuck whoever masochist came up with 1-based indexes in Lua. It's
causing off-by-one errors literally everywhere, and unfortunately that's
not even the worst part about this horrible language.
Fixes#58
0 commit comments