Align "now" time with other times

This commit is contained in:
Joscha 2021-12-22 17:01:06 +00:00
parent 7a67d01e1f
commit 2b88008ba3

View file

@ -72,7 +72,7 @@ impl ShowLines {
fn display_line_now(&mut self, spans: &[Option<SpanSegment>], time: Time) { fn display_line_now(&mut self, spans: &[Option<SpanSegment>], time: Time) {
self.push(&format!( self.push(&format!(
"{:>nw$} {} {}\n", "{:>nw$} {} {}\n",
"now".bright_cyan().bold(), "now".bright_cyan().bold(),
self.display_spans(spans, " ".into()), self.display_spans(spans, " ".into()),
Self::display_time(Times::At(time)), Self::display_time(Times::At(time)),
@ -95,7 +95,7 @@ impl ShowLines {
}; };
self.push(&format!( self.push(&format!(
"{:>nw$} {} {} {}{}{}\n", "{:>nw$} {} {}{} {}{}\n",
num.bright_black(), num.bright_black(),
self.display_spans(spans, " ".into()), self.display_spans(spans, " ".into()),
Self::display_kind(kind), Self::display_kind(kind),
@ -128,8 +128,8 @@ impl ShowLines {
fn display_time(time: Times) -> ColoredString { fn display_time(time: Times) -> ColoredString {
match time { match time {
Times::Untimed => "".into(), Times::Untimed => "".into(),
Times::At(t) => format!("{} ", t).bright_black(), Times::At(t) => format!(" {}", t).bright_black(),
Times::FromTo(t1, t2) => format!("{}--{} ", t1, t2).bright_black(), Times::FromTo(t1, t2) => format!(" {}--{}", t1, t2).bright_black(),
} }
} }