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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user