Commit Graph

2 Commits

Author SHA1 Message Date
Constantin Nickel da3aa4e2fd Use `nu-ansi-term` instead of `ansi_term`
The `nu-ansi-term` crate is a fork of `ansi_term` which is maintained by
the Nushell project.
2023-03-24 17:42:54 +01:00
Martin Nordholts 47bb4a9c0f Introduce bat_warning! helper macro
This macro is intended to be package-internal and is not to be
considered part of the public lib API.

Use it in three places to reduce code duplication. However, main reason
for this refactoring is to allow us to fix #1063 without duplicating the
code yet another time.

The macro can also be used for the "Binary content from {} will not be
printed to the terminal" message if that message starts to use eprintln!
instead (if ever).

To trigger/verify the changed code, the following commands can be used:

    cargo run -- --theme=ansi-light tests/examples/single-line.txt
    cargo run -- --theme=does-not-exist tests/examples/single-line.txt
    cargo run -- --style=grid,rule tests/examples/single-line.txt
2020-12-28 09:27:40 +01:00