-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complex formatting settings are ignored #59
Comments
That does indeed look like a bug to me, albeit a difficult one to fix. |
I am hitting the same problem :-( |
I have forked this library because I needed it to depend on Style::default().paint_fn(|f| write!(f, "{:.5}", 1.0)) I leave you the link to the coverage, repository and documentation |
d-e-s-o
added a commit
to d-e-s-o/apcacli
that referenced
this issue
May 16, 2020
Colors can help a lot in decreasing the time it takes to understand a listing or at least infer where to look at more closely. To that end, this change enables the coloring of gains/losses when printing positions. There are various crates that allow us to colorize text in a terminal using ANSI escape sequences, all with different trade-offs. We currently rely on the yansi crate for doing this job. The downside is that it is a new dependency. Ideally we would want to use ansi_term instead (which is already pulled in by other dependencies), but it turns out that the color enabled strings it produces do not handle advanced formatting options as we use them properly. See ogham/rust-ansi-term#59 for details. We also have used the colored crate successfully, but it does not support RGB colors (only predefined ones) and the default green is commonly too bright. Also, it comes with more dependencies than seemingly necessary.
d-e-s-o
added a commit
to d-e-s-o/apcacli
that referenced
this issue
Jun 21, 2020
Colors can help a lot in decreasing the time it takes to understand a listing or at least infer where to look at more closely. To that end, this change enables the coloring of gains/losses when printing positions. There are various crates that allow us to colorize text in a terminal using ANSI escape sequences, all with different trade-offs. We currently rely on the yansi crate for doing this job. The downside is that it is a new dependency. Ideally we would want to use ansi_term instead (which is already pulled in by other dependencies), but it turns out that the color enabled strings it produces do not handle advanced formatting options as we use them properly. See ogham/rust-ansi-term#59 for details. We also have used the colored crate successfully, but it does not support RGB colors (only predefined ones) and the default green is commonly too bright. Also, it comes with more dependencies than seemingly necessary.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to migrate my project from using colored to
ansi_term
, as one of my dependencies already uses the latter. I was expecting this to be a straightforward replacement, but faced an issue: theDisplay
implementation inansi_term
seems to ignore the formatting settings, e.g. with the following codethe expected behavior is: the provided format string is used; red string
12345
is printed;the actual behavior is: the formatting settings are ignored; red string
1234567890
is printed.Is this intentional, or a bug?
rustc
: 1.38.0ansi_term
: 0.12.1The text was updated successfully, but these errors were encountered: