1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-06-30 06:10:40 +02:00

Fix \r character being printed with wrapping enabled.

This commit is contained in:
eth-p
2018-05-14 14:36:08 -07:00
parent b327127f37
commit a5a7dc14e4

@ -142,8 +142,9 @@ impl<'a> Printer<'a> {
)?;
} else {
for &(style, text) in regions.iter() {
let mut chars = text.chars().filter(|c| *c != '\n');
let mut remaining = text.chars().filter(|c| *c != '\n').count();
let text = text.trim_right_matches(|c| c == '\r' || c == '\n');
let mut chars = text.chars();
let mut remaining = text.chars().count();
while remaining > 0 {
let available = cursor_max - cursor;