dont issue trailing whitespaces
This commit is contained in:
parent
5d3b50d552
commit
cfcc514fa3
|
@ -148,7 +148,7 @@ impl Formatter {
|
|||
|
||||
for [id, date, start, end, duration, note] in lines {
|
||||
let first_line = format!(
|
||||
"{} {} {} {} {} ",
|
||||
"{} {} {} {} {}",
|
||||
lpad(&id, 3.max(lengths[0])),
|
||||
rpad(&date, 18),
|
||||
rpad(&start, 10),
|
||||
|
@ -156,14 +156,18 @@ impl Formatter {
|
|||
lpad(&duration, 8.max(lengths[4])),
|
||||
);
|
||||
|
||||
let space_left = term_width.saturating_sub(first_line.len()).max(40);
|
||||
let space_left = term_width.saturating_sub(first_line.len() + 1).max(40);
|
||||
let note_lines = constrained_lines(¬e, space_left);
|
||||
|
||||
for (i, note_line) in note_lines.into_iter().enumerate() {
|
||||
if i == 0 {
|
||||
writeln!(out, "{}{}", first_line, note_line)?;
|
||||
if note_line.len() != 0 {
|
||||
writeln!(out, "{} {}", first_line, note_line)?;
|
||||
} else {
|
||||
writeln!(out, "{}", first_line)?;
|
||||
}
|
||||
} else {
|
||||
writeln!(out, "{}{}", " ".repeat(first_line.len()), note_line)?;
|
||||
writeln!(out, "{} {}", " ".repeat(first_line.len()), note_line)?;
|
||||
}
|
||||
|
||||
if note_line.len() > max_note_length {
|
||||
|
|
Loading…
Reference in New Issue