Skip to content

Commit

Permalink
Added line limitation of 100 chars to footers
Browse files Browse the repository at this point in the history
  • Loading branch information
Sascha Grunert authored and Sascha Grunert committed Sep 20, 2016
1 parent 8ee90d1 commit 755f216
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,20 @@ impl ParsedTag {
trywln!(term, "\n{}:", key);
trywln!(vec, "\n{}:", key);
try!(term.reset());
trywln!(term, "{}", values.join(", "));
trywln!(vec, "{}", values.join(", "));
let footer_string = values.join(", ");
let mut char_count = 0;
let mut footer_lines = String::new();
for cur_char in footer_string.chars() {
if char_count > 100 && cur_char == ' ' {
footer_lines.push('\n');
char_count = 0;
} else {
footer_lines.push(cur_char);
char_count += 1;
}
}
trywln!(term, "{}", footer_lines);
trywln!(vec, "{}", footer_lines);
}
Ok(())
}
Expand Down

0 comments on commit 755f216

Please sign in to comment.