zkat / miette

Fancy extension for std::error::Error with pretty, detailed diagnostic printing.
https://docs.rs/miette
Apache License 2.0
1.85k stars 106 forks source link

fix(graphical): fix nested error wrapping #358

Closed TheLostLambda closed 3 months ago

TheLostLambda commented 3 months ago

Fixes #333

Here is an error now nicely wrapping (with the 2 char padding on either side) of a 50-char wide terminal: image

TheLostLambda commented 3 months ago

There is a second error here too that's come up! The prefixes for #[related] errors are messing up the line-width calculations: image

The easiest solution seems to be changing the header to always add a newline after one of these tags — something that I think looks nicer anyways! image

I'll also include that change in this PR!

TheLostLambda commented 3 months ago

I've also fixed the spacing around / between related errors, and I'm trying to fix up some unrelated CI breakage (the new nightly compiler seems to be much better at / to much more aggressively detect dead code!)

TheLostLambda commented 3 months ago

Oof, lots of little things making that slightly tricky, but ready for review now! I tried to keep some nice and meaningful commits if you're the type of person to review those diffs one-at-a-time!

TheLostLambda commented 3 months ago

Finally, if you're looking for more example outputs and how they have changed / been restyled, here are plenty more examples: https://github.com/TheLostLambda/smithereens/commit/23a4093afc17c48eb7cda4f71faab44828719245

zkat commented 3 months ago

Thanks for taking care of this! this looks a lot better :)