- Adapt to `thing.paint(style)` API; was `style.paint(thing)`
- Remove `yansi::Paint::enable_windows_ascii()` in style usage decision;
removed in yansi commit b186eb5bfb, which introduced "automatic"
support for Windows: "If support is not available, styling is disabled
and no styling sequences are emitted", fitting the `Auto` option
- Respect `--color=always` even if we know it won't work
---------
Co-authored-by: Niklas Mohrin <dev@niklasmohrin.de>
ansi_term is not actively maintained anymore (see
https://rustsec.org/advisories/RUSTSEC-2021-0139). Replace it with a
suitable alternative.
I looked at termcolor, owo-colors and yansi and picked yansi:
- It is very simple
- It does not do terminal color support checking (we already do that in
tealdeer)
- Its color enum type is almost identical to the one from ansi_term, so
migrating is easy
The only change from a config API point of view is that "purple" is now
renamed to "magenta", but "purple" still works.