From 3bdb2ecb1f3a0d1a0122c655a47219e6627bf4a2 Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Mon, 14 May 2018 10:04:24 -0500 Subject: [PATCH] Fix padding issue in context listing. --- pit.nimble | 2 +- src/pit.nim | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pit.nimble b/pit.nimble index 6c96f4d..e1b74fa 100644 --- a/pit.nimble +++ b/pit.nimble @@ -1,6 +1,6 @@ # Package -version = "4.0.3" +version = "4.0.4" author = "Jonathan Bernard" description = "Personal issue tracker." license = "MIT" diff --git a/src/pit.nim b/src/pit.nim index e962c77..9446246 100644 --- a/src/pit.nim +++ b/src/pit.nim @@ -112,12 +112,13 @@ proc writeSection(ctx: CliContext, issues: seq[Issue], state: IssueState, stdout.writeLine("") stdout.resetAttributes - var topPadded = true - let issuesByContext = issues.groupBy("context") + var topPadded = true + if issues.len > 5 and issuesByContext.len > 1: for context, ctxIssues in issuesByContext: + topPadded = true stdout.setForegroundColor(fgYellow, false) stdout.writeLine(indent & ctx.getIssueContextDisplayName(context) & ":") stdout.writeLine("") @@ -261,7 +262,7 @@ Options: logging.addHandler(newConsoleLogger()) # Parse arguments - let args = docopt(doc, version = "pit 4.0.3") + let args = docopt(doc, version = "pit 4.0.4") if args["--echo-args"]: stderr.writeLine($args)