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
No known key found for this signature in database
GPG Key ID: 1F8DF8091CD46FBC

View File

@ -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;