mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-05-19 01:30:21 -07:00
grep-printer: fix bug in printing truncated lines
When emitting color, the printer wasn't checking whether the line exceeded the maximum allowed length.
This commit is contained in:
parent
5b1ce8bdc2
commit
74a89be641
@ -1201,6 +1201,9 @@ impl<'a, M: Matcher, W: WriteColor> StandardImpl<'a, M, W> {
|
||||
if !self.wtr().borrow().supports_color() || spec.is_none() {
|
||||
return self.write_line(line);
|
||||
}
|
||||
if self.exceeds_max_columns(line) {
|
||||
return self.write_exceeded_line();
|
||||
}
|
||||
|
||||
let mut last_written =
|
||||
if !self.config().trim_ascii {
|
||||
|
Loading…
x
Reference in New Issue
Block a user