Fix \r character being printed with wrapping enabled.

pull/102/head
eth-p 6 years ago
parent b327127f37
commit a5a7dc14e4
No known key found for this signature in database
GPG Key ID: 1F8DF8091CD46FBC

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

Loading…
Cancel
Save