1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-06-25 14:22:54 +02:00

Only emit bold ANSI code if bold is true.

This was a simple logic error. Also, avoid emitting ANSI escape codes
if there are no color settings.

Fixes #242
This commit is contained in:
Andrew Gallant
2016-11-21 20:33:15 -05:00
parent a5e7f176f1
commit ae592b11e3
2 changed files with 7 additions and 2 deletions

View File

@ -260,7 +260,7 @@ impl<W: WriteColor> Printer<W> {
}
fn write_matched_line(&mut self, re: &Regex, buf: &[u8]) {
if !self.wtr.supports_color() {
if !self.wtr.supports_color() || self.colors.matched().is_none() {
self.write(buf);
return;
}