From d1c71885288180c0baddde0260aff8370089672d Mon Sep 17 00:00:00 2001 From: Zoe Moore Date: Tue, 28 Jun 2022 17:16:31 -0700 Subject: [PATCH] Fix indentation --- bt.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bt.nim b/bt.nim index f24dc06..1ee3125 100644 --- a/bt.nim +++ b/bt.nim @@ -33,7 +33,7 @@ proc formatDepartures(etd: JSONNode): string = styledEcho styleBright, name & " - " & now().format("H:mm") - let maxDestLength = lines.map(proc (line: JSONNode) = line["destination"].getStr.len).foldl(max(a,b), 1) + let maxDestLength = lines.getElems.map(proc (line: JSONNode): int = line["destination"].getStr.len).foldl(max(a,b), 1) for line in lines: let dest = line["destination"].getStr @@ -43,7 +43,7 @@ proc formatDepartures(etd: JSONNode): string = if len(line["estimate"]) > 1: estimate = estimate & ", " & formatEstimateMinutes(line["estimate"][1]["minutes"].getStr) - styledEcho lineColor(color), &"{dest}\t\t{estimate}" + styledEcho lineColor(color), dest & indent(estimate, max(maxDestLength + 3 - len(dest), 0)) proc usage() = echo """bt - bart times cli