Closed hasezoey closed 1 year ago
It's left, center and right. Would you be able to submit a PR?
It's left, center and right
this is what i expected, i assume you mean <^>
as left, center and right respectively, but what do the other 2 characters, namely [
and ]
do in this case? if the do nothing, why are they included? (the other mentions in the text-box dont have extra characters or make clear what is meant)
also as a side note, how does alignment interact with wide_*
elements?
The [
and ]
are likely a reference to how regular expressions usually define character classes, they are not actual alignment characters. See parser code: https://github.com/console-rs/indicatif/blob/main/src/style.rs#L505. The documentation might be inconsistent because different parts were written by different people at different times, again feel free to submit a PR to improve on the current situation.
The interaction between padding (what wide_*
does) and alignment can be reviewed here: https://github.com/console-rs/indicatif/blob/main/src/style.rs#L691.
Currently the documentation lists
[<^>] for an optional alignment specification
but does not specify what each character does and where it aligns to.I would expect there to only be 2 characters, plus maybe a center character but am not sure which are which and what the others do.