Skip to content

Commit

Permalink
Merge pull request #2651 from AbyssAbuse/master
Browse files Browse the repository at this point in the history
Make colorizer respect `AppSettings::ColorAlways` / `ColorChoice::Always`
  • Loading branch information
pksunkara authored Aug 1, 2021
2 parents 4abf5fe + faa25f9 commit 25f6958
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/output/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ impl Colorizer {
pub(crate) fn print(&self) -> io::Result<()> {
use termcolor::{BufferWriter, ColorSpec, WriteColor};

let color_when = if is_a_tty(self.use_stderr) {
self.color_when
} else {
ColorChoice::Never
let color_when = match self.color_when {
always @ ColorChoice::Always => always,
choice if is_a_tty(self.use_stderr) => choice,
_ => ColorChoice::Never,
};

let writer = if self.use_stderr {
Expand Down

0 comments on commit 25f6958

Please sign in to comment.